summaryrefslogtreecommitdiff
path: root/bin/rm
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-06-14 19:15:36 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-06-14 19:15:36 +0000
commitd2c8541ff7a6aa3936703af8a6d081aad0f8c4d7 (patch)
tree989d86333b7bb2f764c89cbcfd7cc74973a3308c /bin/rm
parentc1f50fdfbb69345741fe1c0eb285e1d7a98a2105 (diff)
whiteouts are gone
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.18
-rw-r--r--bin/rm/rm.c37
2 files changed, 10 insertions, 35 deletions
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index d9e7d6c6631..699f6be7f1c 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rm.1,v 1.24 2003/11/21 21:04:36 jmc Exp $
+.\" $OpenBSD: rm.1,v 1.25 2005/06/14 19:15:35 millert Exp $
.\" $NetBSD: rm.1,v 1.8 1995/07/25 19:37:30 jtc Exp $
.\"
.\" Copyright (c) 1990, 1993, 1994
@@ -42,7 +42,7 @@
.Sh SYNOPSIS
.Nm rm
.Op Fl f | Fl i
-.Op Fl dPRrW
+.Op Fl dPRr
.Ar file Op Ar ...
.Sh DESCRIPTION
The
@@ -104,10 +104,6 @@ that directory is skipped.
.It Fl r
Equivalent to
.Fl R .
-.It Fl W
-Attempts to undelete the named files.
-Currently, this option can only be used to recover
-files covered by whiteouts on union mounts.
.El
.Pp
The
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 25640f7d09c..e7edf6ebcb4 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rm.c,v 1.17 2004/06/02 06:58:54 otto Exp $ */
+/* $OpenBSD: rm.c,v 1.18 2005/06/14 19:15:35 millert 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.17 2004/06/02 06:58:54 otto Exp $";
+static char rcsid[] = "$OpenBSD: rm.c,v 1.18 2005/06/14 19:15:35 millert Exp $";
#endif
#endif /* not lint */
@@ -63,7 +63,7 @@ static char rcsid[] = "$OpenBSD: rm.c,v 1.17 2004/06/02 06:58:54 otto Exp $";
extern char *__progname;
-int dflag, eval, fflag, iflag, Pflag, Wflag, stdin_ok;
+int dflag, eval, fflag, iflag, Pflag, stdin_ok;
int check(char *, char *, struct stat *);
void checkdot(char **);
@@ -88,7 +88,7 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
Pflag = rflag = 0;
- while ((ch = getopt(argc, argv, "dfiPRrW")) != -1)
+ while ((ch = getopt(argc, argv, "dfiPRr")) != -1)
switch(ch) {
case 'd':
dflag = 1;
@@ -108,9 +108,6 @@ main(int argc, char *argv[])
case 'r': /* Compatibility. */
rflag = 1;
break;
- case 'W':
- Wflag = 1;
- break;
default:
usage();
}
@@ -157,8 +154,6 @@ rm_tree(char **argv)
flags = FTS_PHYSICAL;
if (!needstat)
flags |= FTS_NOSTAT;
- if (Wflag)
- flags |= FTS_WHITEOUT;
if (!(fts = fts_open(argv, flags, NULL)))
err(1, NULL);
while ((p = fts_read(fts)) != NULL) {
@@ -217,12 +212,6 @@ rm_tree(char **argv)
continue;
break;
- case FTS_W:
- if (!undelete(p->fts_accpath) ||
- (fflag && errno == ENOENT))
- continue;
- break;
-
default:
if (Pflag)
if (!rm_overwrite(p->fts_accpath, NULL))
@@ -252,18 +241,10 @@ rm_file(char **argv)
while ((f = *argv++) != NULL) {
/* Assume if can't stat the file, can't unlink it. */
if (lstat(f, &sb)) {
- if (Wflag) {
- sb.st_mode = S_IFWHT|S_IWUSR|S_IRUSR;
- } else {
- if (!fflag || errno != ENOENT) {
- warn("%s", f);
- eval = 1;
- }
- continue;
+ if (!fflag || errno != ENOENT) {
+ warn("%s", f);
+ eval = 1;
}
- } else if (Wflag) {
- warnx("%s: %s", f, strerror(EEXIST));
- eval = 1;
continue;
}
@@ -272,10 +253,8 @@ rm_file(char **argv)
eval = 1;
continue;
}
- if (!fflag && !S_ISWHT(sb.st_mode) && !check(f, f, &sb))
+ if (!fflag && !check(f, f, &sb))
continue;
- if (S_ISWHT(sb.st_mode))
- rval = undelete(f);
else if (S_ISDIR(sb.st_mode))
rval = rmdir(f);
else {