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:
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/posix/readdir_r.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index e16fe1273..a6292f4bf 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/posix/readdir_r.c: Fix return code when end of
+ directory is reached.
+
2012-02-23 Dan Egnor <egnor@ofb.net>
* configure.host: Accept "arm*" host spec instead of just "arm".
diff --git a/newlib/libc/posix/readdir_r.c b/newlib/libc/posix/readdir_r.c
index 9bc013c64..b9a0b9024 100644
--- a/newlib/libc/posix/readdir_r.c
+++ b/newlib/libc/posix/readdir_r.c
@@ -76,7 +76,7 @@ struct dirent *tmpdp;
__lock_release_recursive(dirp->dd_lock);
#endif
*dpp = NULL;
- return errno;
+ return dirp->dd_size == 0 ? 0 : errno;
}
}
if (dirp->dd_loc >= dirp->dd_size) {