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>
This commit is contained in:
parent
aa8689ef95
commit
b800f53d91
12
bin/rm/rm.c
12
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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user