From 727a81f4d93f3715d3692685915f99fca5106a8a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 1 Apr 2012 07:19:52 +0000 Subject: * devices.h (device::exists_func): Redefine field. (device::dev_on_fs): Remove unneeded bit field. Just make a normal boolean. (device::exists): Redefine function. * devices.in: Move previous functions earlier since they are now only defined static. Rename some functions due to an as-yet unresolved bug in gendevices. Rename posix part of internal-only devices with a double-slash. gendevices will eventuall translate that to a ":". (device::parse): Rework to use dev pointer and dev_storage_end. * devices.cc: Regenerate. * gendevices: Translate "// to ": after shilka processing. --- winsup/cygwin/fhandler_dev.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fhandler_dev.cc') diff --git a/winsup/cygwin/fhandler_dev.cc b/winsup/cygwin/fhandler_dev.cc index 82bd2fa82..d4a3e0c86 100644 --- a/winsup/cygwin/fhandler_dev.cc +++ b/winsup/cygwin/fhandler_dev.cc @@ -119,7 +119,10 @@ fhandler_dev::readdir (DIR *dir, dirent *de) while (devidx < dev_storage_end) { const device& thisdev = *devidx++; - if (!thisdev.exists ()) + /* If exists returns < 0 it means that the device can be used by a + program but its use is deprecated and, so, it is not returned + by readdir((). */ + if (thisdev.exists () <= 0) continue; ++dir->__d_position; strcpy (de->d_name, thisdev.name + dev_prefix_len); -- cgit v1.2.3