Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_dev.cc')
-rw-r--r--winsup/cygwin/fhandler_dev.cc5
1 files changed, 4 insertions, 1 deletions
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);