summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/readdir_r.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2006-08-30 17:24:44 +0000
committerEric Andersen <andersen@codepoet.org>2006-08-30 17:24:44 +0000
commit285768c7f05c53e07ce5899e75baa083d28efad7 (patch)
treed0e4c98ce8186b46a04c732d74db340ff931d58a /libc/misc/dirent/readdir_r.c
parent245b4053dc63c5e23864fd1a57d595df2a5f06f7 (diff)
fix bug 1012 as noted by moschny
Diffstat (limited to 'libc/misc/dirent/readdir_r.c')
-rw-r--r--libc/misc/dirent/readdir_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/misc/dirent/readdir_r.c b/libc/misc/dirent/readdir_r.c
index 2c44707f2..a1d8b9a77 100644
--- a/libc/misc/dirent/readdir_r.c
+++ b/libc/misc/dirent/readdir_r.c
@@ -34,7 +34,7 @@ int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result)
bytes = __getdents(dir->dd_fd, dir->dd_buf, dir->dd_max);
if (bytes <= 0) {
*result = NULL;
- ret = errno;
+ ret = (bytes==0)? 0 : errno;
goto all_done;
}
dir->dd_size = bytes;