From bbd000ecddcd2ee2a48b8105d8c584459a03f6d5 Mon Sep 17 00:00:00 2001 From: kuriyama Date: Thu, 1 Jan 2004 10:26:43 +0000 Subject: 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> --- bin/rm/rm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bin') 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)) -- cgit v1.1