diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2012-03-02 20:02:04 +0400 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2012-03-02 20:02:04 +0400 |
commit | 52cbb05cfb0556653faa1f4e06a5ede5c80b2c81 (patch) | |
tree | 6487b9f058c0bb75ffc6b360918d18cdf6ee5647 /newlib | |
parent | 2e398e84376c5a238a1b5dd0a9669ff289259064 (diff) |
2012-03-02 Jeff Johnston <jjohnstn@redhat.com>
* libc/posix/readdir_r.c: Fix return code when end of
directory is reached.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/posix/readdir_r.c | 2 |
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) { |