summaryrefslogtreecommitdiff
path: root/lib/ftw.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-01-22 15:45:48 +0000
committerJim Meyering <jim@meyering.net>2003-01-22 15:45:48 +0000
commitf0a528b13a71beaa24def74d4b5b2233b389200e (patch)
treea906b565ad770a817f1231ca4df046e54c167396 /lib/ftw.c
parent5b7ab2372d0c73b51cb22ff67d74a4ac7dcd9c54 (diff)
downloadcoreutils-f0a528b13a71beaa24def74d4b5b2233b389200e.tar.xz
(process_entry): Handle FTW_DCHP.
(ftw_dir): Handle FTW_DCH.
Diffstat (limited to 'lib/ftw.c')
-rw-r--r--lib/ftw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ftw.c b/lib/ftw.c
index 3fe76d1cd..0843c11cf 100644
--- a/lib/ftw.c
+++ b/lib/ftw.c
@@ -398,6 +398,12 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
if (__chdir ("..") < 0)
result = -1;
}
+
+ if (result < 0)
+ {
+ result = (*data->func) (data->dirbuf, NULL, FTW_DCHP,
+ &data->ftw);
+ }
}
}
}
@@ -464,6 +470,10 @@ ftw_dir (struct ftw_data *data, struct STAT *st)
data->actdir = data->maxdir - 1;
data->dirstreams[data->actdir] = NULL;
+ /* We cannot change to the directory.
+ Signal this with a special flag. */
+ result = (*data->func) (data->dirbuf, st, FTW_DCH, &data->ftw);
+
return result;
}
}