From 285768c7f05c53e07ce5899e75baa083d28efad7 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 30 Aug 2006 17:24:44 +0000 Subject: fix bug 1012 as noted by moschny --- libc/misc/dirent/readdir_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/misc/dirent') 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; -- cgit v1.2.3