OSDN Git Service

* fhandler_disk_file.cc (fhandler_cygdrive::readdir): Do not change 'errno' if
authorcgf <cgf>
Tue, 5 Aug 2003 03:04:28 +0000 (03:04 +0000)
committercgf <cgf>
Tue, 5 Aug 2003 03:04:28 +0000 (03:04 +0000)
end of directory condition is encountered as per SUSv2.
* fhandler_proc.cc (fhandler_proc::readdir): Ditto.
* fhandler_process (fhandler_process::readdir): Ditto.
* fhandler_registry (fhandler_registry::readdir): Ditto.

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

index 1837130..10a5605 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-05  Pavel Tsekov  <ptsekov@gmx.net>
+
+       * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Do not change
+       'errno' if end of directory condition is encountered as per SUSv2.
+       * fhandler_proc.cc (fhandler_proc::readdir): Ditto.
+       * fhandler_process (fhandler_process::readdir): Ditto.
+       * fhandler_registry (fhandler_registry::readdir): Ditto.
+
 2003-07-30  Christopher Faylor  <cgf@redhat.com>
 
        * dcrt0.cc (_dll_crt0): Move strace.microseconds initialization to
index be634bd..5b873a0 100644 (file)
@@ -769,10 +769,7 @@ fhandler_cygdrive::readdir (DIR *dir)
   if (!iscygdrive_root ())
     return fhandler_disk_file::readdir (dir);
   if (!pdrive || !*pdrive)
-    {
-      set_errno (ENMFILE);
-      return NULL;
-    }
+    return NULL;
   else if (dir->__d_position > 1
           && GetFileAttributes (pdrive) == INVALID_FILE_ATTRIBUTES)
     {
index d7f5a1a..5840642 100644 (file)
@@ -206,7 +206,6 @@ fhandler_proc::readdir (DIR * dir)
            dir->__d_position++;
            return dir->__d_dirent;
          }
-      set_errno (ENMFILE);
       return NULL;
     }
 
index 193fd95..44b7189 100644 (file)
@@ -147,10 +147,7 @@ struct dirent *
 fhandler_process::readdir (DIR * dir)
 {
   if (dir->__d_position >= PROCESS_LINK_COUNT)
-    {
-      set_errno (ENMFILE);
-      return NULL;
-    }
+    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 85ea02f..39a8920 100644 (file)
@@ -331,7 +331,8 @@ retry:
     {
       RegCloseKey ((HKEY) dir->__d_u.__d_data.__handle);
       dir->__d_u.__d_data.__handle = INVALID_HANDLE_VALUE;
-      seterrno_from_win_error (__FILE__, __LINE__, error);
+      if (error != ERROR_NO_MORE_ITEMS)
+       seterrno_from_win_error (__FILE__, __LINE__, error);
       goto out;
     }