diff options
Diffstat (limited to 'io')
-rw-r--r-- | io/fts.c | 5 | ||||
-rw-r--r-- | io/ftw.c | 6 |
2 files changed, 5 insertions, 6 deletions
@@ -570,7 +570,7 @@ fts_build(sp, type) register FTS *sp; int type; { - struct dirent dirbuf, *dp; + struct dirent *dp; register FTSENT *p, *head; register int nitems; FTSENT *cur, *tail; @@ -660,8 +660,7 @@ fts_build(sp, type) /* Read the directory, attaching each entry to the `link' pointer. */ adjaddr = NULL; - for (head = tail = NULL, nitems = 0; - __readdir_r (dirp, &dirbuf, &dp) >= 0;) { + for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) { int namlen; if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) @@ -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; } } |