about summary refs log tree commit diff
path: root/io/ftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/ftw.c')
-rw-r--r--io/ftw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io/ftw.c b/io/ftw.c
index b7983d4525..6bd97e6999 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -39,13 +39,13 @@ ftw_dir (DIR **dirs, int level, int descriptors, char *dir, size_t len,
 	 int (*func) (const char *file, struct stat *status, int flag))
 {
   int got;
-  struct dirent dirbuf, *entry;
+  struct dirent *entry;
 
   got = 0;
 
   __set_errno (0);
 
-  while (__readdir_r (dirs[level], &dirbuf, &entry) >= 0)
+  while ((entry = readdir (dirs[level])) != NULL)
     {
       struct stat s;
       int flag, retval, newlev;
@@ -136,7 +136,7 @@ ftw_dir (DIR **dirs, int level, int descriptors, char *dir, size_t len,
 	  while (skip-- != 0)
 	    {
 	      __set_errno (0);
-	      if (__readdir_r (dirs[level], &dirbuf, &entry) < 0)
+	      if (readdir (dirs[level]) == NULL)
 		return errno == 0 ? 0 : -1;
 	    }
 	}