summaryrefslogtreecommitdiffstats
path: root/bin/rm/rm.c
diff options
context:
space:
mode:
authorats <ats@FreeBSD.org>1994-08-28 18:34:50 +0000
committerats <ats@FreeBSD.org>1994-08-28 18:34:50 +0000
commitb7079cf51c68c5d0d95d1488fe15554bd90c0e45 (patch)
treec570b8ce1e2a9fcf6b91f0fb9c5ef3d46122c658 /bin/rm/rm.c
parent7a562692a6f4782dd6593102f898cd1366b7ec39 (diff)
downloadFreeBSD-src-b7079cf51c68c5d0d95d1488fe15554bd90c0e45.zip
FreeBSD-src-b7079cf51c68c5d0d95d1488fe15554bd90c0e45.tar.gz
Reviewed by:
Submitted by: Added the FTS_NOCHDIR flag to the fts-open call. This is needed, so that the fts don't change the current directory for rm and subsequent calls to rmdir with relative pathnames don't fail. Pulled over the bugfix in 1.1.5.
Diffstat (limited to 'bin/rm/rm.c')
-rw-r--r--bin/rm/rm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 4cdf055..08016fd 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -141,8 +141,8 @@ rm_tree(argv)
#define SKIPPED 1
if (!(fts = fts_open(argv,
- needstat ? FTS_PHYSICAL : FTS_PHYSICAL|FTS_NOSTAT,
- (int (*)())NULL)))
+ needstat ? FTS_PHYSICAL|FTS_NOCHDIR :
+ FTS_PHYSICAL|FTS_NOSTAT|FTS_NOCHDIR, (int (*)())NULL)))
err(1, NULL);
while ((p = fts_read(fts)) != NULL) {
switch (p->fts_info) {
OpenPOWER on IntegriCloud