aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-11-20 00:12:08 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-11-20 00:12:08 +0000
commitd4af5f325030eae72bb7c6c54592e02b1b8f7af0 (patch)
tree7164983aa0362431e40cc75d6751108bad72761e /bin
parent654ec778779e8727d7f451fd7d4b7a691b4fd14c (diff)
downloadsrc-d4af5f325030eae72bb7c6c54592e02b1b8f7af0.tar.gz
src-d4af5f325030eae72bb7c6c54592e02b1b8f7af0.zip
Fixed "rmdir -p" that got broken by rev. 1.15.
(This also fixes "rmdir -v /nonexistent".)
Notes
Notes: svn path=/head/; revision=137901
Diffstat (limited to 'bin')
-rw-r--r--bin/rmdir/rmdir.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c
index 0317d07eae94..85dfde140b1e 100644
--- a/bin/rmdir/rmdir.c
+++ b/bin/rmdir/rmdir.c
@@ -78,15 +78,14 @@ main(int argc, char *argv[])
usage();
for (errors = 0; *argv; argv++) {
- if (pflag) {
- errors |= rm_path(*argv);
+ if (rmdir(*argv) < 0) {
+ warn("%s", *argv);
+ errors = 1;
} else {
- if (rmdir(*argv) < 0) {
- warn("%s", *argv);
- errors = 1;
- }
if (vflag)
printf("%s\n", *argv);
+ if (pflag)
+ errors |= rm_path(*argv);
}
}