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:
authorChristopher Faylor <me@cgf.cx>2002-06-01 00:30:36 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-01 00:30:36 +0400
commit18c04cc4b2cc8ed4afecec03bb4cf12f35312c36 (patch)
tree3319b890ca8d7e8642e893e4c8e13a61c337f22b /winsup/cygwin
parentea55e3f7f3a213d4e3b5bdf966eecaf0aa1b7112 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/fhandler_proc.cc1
-rw-r--r--winsup/cygwin/fhandler_process.cc5
-rw-r--r--winsup/cygwin/fhandler_registry.cc3
4 files changed, 13 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ee7c10d33..8d816fac5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 3a8990bb7..27a822096 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -216,6 +216,7 @@ fhandler_proc::readdir (DIR * dir)
}
found++;
}
+ set_errno (ENMFILE);
return NULL;
}
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index c71329ef2..3858a2116 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -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);
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index cbf73f58f..b4f0eeb59 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -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;
}