summaryrefslogtreecommitdiff
path: root/libc/misc/dirent
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-09-15 09:24:42 +0000
committerMike Frysinger <vapier@gentoo.org>2007-09-15 09:24:42 +0000
commitf5582f19d919de215b4d07af3fb18b6416a43344 (patch)
treefdb4e082c945e29acdc11c5ffbab8a4b7a41aa8a /libc/misc/dirent
parent46447589470fd53abd88402bd1f562c0370aa361 (diff)
also fix bug 1012 by moschny in 64bit version of readdir
Diffstat (limited to 'libc/misc/dirent')
-rw-r--r--libc/misc/dirent/readdir64_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/misc/dirent/readdir64_r.c b/libc/misc/dirent/readdir64_r.c
index 23fd8f6d9..19c14496f 100644
--- a/libc/misc/dirent/readdir64_r.c
+++ b/libc/misc/dirent/readdir64_r.c
@@ -37,7 +37,7 @@ int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result)
bytes = __getdents64(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;