OSDN Git Service

* fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more files.
authorcgf <cgf>
Fri, 31 May 2002 20:30:35 +0000 (20:30 +0000)
committercgf <cgf>
Fri, 31 May 2002 20:30:35 +0000 (20:30 +0000)
* fhandler_process.cc (fhandler_process::readdir): Ditto.
* fhandler_registry.cc (fhandler_registry::readdir): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_proc.cc
winsup/cygwin/fhandler_process.cc
winsup/cygwin/fhandler_registry.cc

index ee7c10d..8d816fa 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-31  Christopher Faylor  <cgf@redhat.com>
+
+       * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more
+       files.
+       * fhandler_process.cc (fhandler_process::readdir): Ditto.
+       * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
+
 2002-05-30  Christopher Faylor  <cgf@redhat.com>
 
        * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES
index 3a8990b..27a8220 100644 (file)
@@ -216,6 +216,7 @@ fhandler_proc::readdir (DIR * dir)
            }
          found++;
        }
+      set_errno (ENMFILE);
       return NULL;
     }
 
index c71329e..3858a21 100644 (file)
@@ -149,7 +149,10 @@ struct dirent *
 fhandler_process::readdir (DIR * dir)
 {
   if (dir->__d_position >= PROCESS_LINK_COUNT)
-    return NULL;
+    {
+      set_errno (ENMFILE);
+      return NULL;
+    }
   strcpy (dir->__d_dirent->d_name, process_listing[dir->__d_position++]);
   syscall_printf ("%p = readdir (%p) (%s)", &dir->__d_dirent, dir,
                  dir->__d_dirent->d_name);
index cbf73f5..b4f0eeb 100644 (file)
@@ -266,8 +266,7 @@ retry:
     {
       RegCloseKey ((HKEY) dir->__d_u.__d_data.__handle);
       dir->__d_u.__d_data.__handle = INVALID_HANDLE_VALUE;
-      if (error != ERROR_NO_MORE_ITEMS)
-       seterrno_from_win_error (__FILE__, __LINE__, error);
+      seterrno_from_win_error (__FILE__, __LINE__, error);
       goto out;
     }