summaryrefslogtreecommitdiffstats
path: root/bin/rmdir
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-11-20 00:12:08 +0000
committerru <ru@FreeBSD.org>2004-11-20 00:12:08 +0000
commitf5e118fbbd40e458a630d053352692c743f73b25 (patch)
tree7164983aa0362431e40cc75d6751108bad72761e /bin/rmdir
parentc52af354ac592d448bdf75cba0ded90e913f0bbc (diff)
downloadFreeBSD-src-f5e118fbbd40e458a630d053352692c743f73b25.zip
FreeBSD-src-f5e118fbbd40e458a630d053352692c743f73b25.tar.gz
Fixed "rmdir -p" that got broken by rev. 1.15.
(This also fixes "rmdir -v /nonexistent".)
Diffstat (limited to 'bin/rmdir')
-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 0317d07..85dfde1 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);
}
}
OpenPOWER on IntegriCloud