summaryrefslogtreecommitdiff
path: root/bin/rm/rm.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-06-06 00:08:58 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-06-06 00:08:58 +0000
commit104292be4aabb0bedbce02d40230ff16cd9c34a3 (patch)
tree73f06371b5718e2d82be4ee86354d375eed1b294 /bin/rm/rm.c
parent1036b82dcc1f2089f2f52002b3b7387f00f6189e (diff)
Unlink files with multiple links when -P flag is specified instead
of just warning and skipping the file. OK millert and jmc.
Diffstat (limited to 'bin/rm/rm.c')
-rw-r--r--bin/rm/rm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index f30d5cefb3f..37aaba962e2 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rm.c,v 1.20 2006/03/21 20:28:52 otto Exp $ */
+/* $OpenBSD: rm.c,v 1.21 2007/06/06 00:08:57 ray Exp $ */
/* $NetBSD: rm.c,v 1.19 1995/09/07 06:48:50 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rm.c 8.8 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: rm.c,v 1.20 2006/03/21 20:28:52 otto Exp $";
+static char rcsid[] = "$OpenBSD: rm.c,v 1.21 2007/06/06 00:08:57 ray Exp $";
#endif
#endif /* not lint */
@@ -214,8 +214,7 @@ rm_tree(char **argv)
default:
if (Pflag)
- if (!rm_overwrite(p->fts_accpath, NULL))
- continue;
+ rm_overwrite(p->fts_accpath, NULL);
if (!unlink(p->fts_accpath) ||
(fflag && errno == ENOENT))
continue;
@@ -260,8 +259,7 @@ rm_file(char **argv)
rval = rmdir(f);
else {
if (Pflag)
- if (!rm_overwrite(f, &sb))
- continue;
+ rm_overwrite(f, &sb);
rval = unlink(f);
}
if (rval && (!fflag || errno != ENOENT)) {