diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-06-06 00:08:58 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-06-06 00:08:58 +0000 |
commit | 104292be4aabb0bedbce02d40230ff16cd9c34a3 (patch) | |
tree | 73f06371b5718e2d82be4ee86354d375eed1b294 /bin/rm | |
parent | 1036b82dcc1f2089f2f52002b3b7387f00f6189e (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')
-rw-r--r-- | bin/rm/rm.1 | 6 | ||||
-rw-r--r-- | bin/rm/rm.c | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index 4543eb0f480..79546caeda0 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rm.1,v 1.30 2007/05/31 19:19:15 jmc Exp $ +.\" $OpenBSD: rm.1,v 1.31 2007/06/06 00:08:57 ray Exp $ .\" $NetBSD: rm.1,v 1.8 1995/07/25 19:37:30 jtc Exp $ .\" .\" Copyright (c) 1990, 1993, 1994 @@ -33,7 +33,7 @@ .\" .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: June 6 2007 $ .Dt RM 1 .Os .Sh NAME @@ -84,7 +84,7 @@ then and then .Li 0xff again, before they are deleted. -Files with multiple links will not be overwritten. +Files with multiple links will be unlinked but not overwritten. .It Fl R Attempt to remove the file hierarchy rooted in each file argument. The 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)) { |