aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
Diffstat (limited to 'io')
-rw-r--r--io/fts.c5
-rw-r--r--io/ftw.c6
2 files changed, 5 insertions, 6 deletions
diff --git a/io/fts.c b/io/fts.c
index 2a7100e..ef0c7a3 100644
--- a/io/fts.c
+++ b/io/fts.c
@@ -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))
diff --git a/io/ftw.c b/io/ftw.c
index b7983d4..6bd97e6 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;
}
}