summaryrefslogtreecommitdiffstats
path: root/bin/rm
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2004-01-01 10:26:43 +0000
committerkuriyama <kuriyama@FreeBSD.org>2004-01-01 10:26:43 +0000
commitbbd000ecddcd2ee2a48b8105d8c584459a03f6d5 (patch)
tree33fb33f0e4bcd6e8d494062da2add3a3996fa88d /bin/rm
parentba7b1a0e6a911a0f437934eaa55397e7d7b370d6 (diff)
downloadFreeBSD-src-bbd000ecddcd2ee2a48b8105d8c584459a03f6d5.zip
FreeBSD-src-bbd000ecddcd2ee2a48b8105d8c584459a03f6d5.tar.gz
o Fix a style bug and poor wording in comment.
o When fts_read() cannot stat the file, it can't be unlinked. At that case, don't display error message when -f flag is used. Obtained from: bde PR: kern/16815, bin/35842 Reported by: kuriyama, Aleksandr A. Babaylov <.@babolo.ru>
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 7458dd0..ccacc18 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -199,8 +199,8 @@ rm_tree(char **argv)
errx(1, "%s: %s", p->fts_path, strerror(p->fts_errno));
case FTS_NS:
/*
- * FTS_NS: assume that if can't stat the file, it
- * can't be unlinked.
+ * Assume that since fts_read() couldn't stat the
+ * file, it can't be unlinked.
*/
if (!needstat)
break;
@@ -269,6 +269,14 @@ rm_tree(char **argv)
}
break;
+ case FTS_NS:
+ /*
+ * Assume that since fts_read() couldn't stat
+ * the file, it can't be unlinked.
+ */
+ if (fflag)
+ continue;
+ /* FALLTHROUGH */
default:
if (Pflag)
if (!rm_overwrite(p->fts_accpath, NULL))
OpenPOWER on IntegriCloud