diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-08-30 17:24:44 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-08-30 17:24:44 +0000 |
commit | 285768c7f05c53e07ce5899e75baa083d28efad7 (patch) | |
tree | d0e4c98ce8186b46a04c732d74db340ff931d58a /libc/misc/dirent/readdir_r.c | |
parent | 245b4053dc63c5e23864fd1a57d595df2a5f06f7 (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.c | 2 |
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; |