summaryrefslogtreecommitdiff
path: root/bin/rm
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2016-06-28 15:20:14 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2016-06-28 15:20:14 +0000
commit8b6cf292d57447457476e65e0b2c180556d91d78 (patch)
tree2c4031676e0ea593bfd7e92e31203757388943cf /bin/rm
parent18166ac04a02243614424ec36c8a4574343ace5c (diff)
don't report errors for 'rm -rf ""'. report by rkitover.
ok benno deraadt
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 2f919ffad9c..70476c87276 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rm.c,v 1.37 2016/04/15 23:09:57 tedu Exp $ */
+/* $OpenBSD: rm.c,v 1.38 2016/06/28 15:20:13 tedu Exp $ */
/* $NetBSD: rm.c,v 1.19 1995/09/07 06:48:50 jtc Exp $ */
/*-
@@ -150,8 +150,11 @@ rm_tree(char **argv)
flags = FTS_PHYSICAL;
if (!needstat)
flags |= FTS_NOSTAT;
- if (!(fts = fts_open(argv, flags, NULL)))
- err(1, NULL);
+ if (!(fts = fts_open(argv, flags, NULL))) {
+ if (!fflag || errno != ENOENT)
+ err(1, NULL);
+ return;
+ }
while ((p = fts_read(fts)) != NULL) {
switch (p->fts_info) {
case FTS_DNR: