diff options
author | ru <ru@FreeBSD.org> | 2004-11-20 00:12:08 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-11-20 00:12:08 +0000 |
commit | f5e118fbbd40e458a630d053352692c743f73b25 (patch) | |
tree | 7164983aa0362431e40cc75d6751108bad72761e /bin | |
parent | c52af354ac592d448bdf75cba0ded90e913f0bbc (diff) | |
download | FreeBSD-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')
-rw-r--r-- | bin/rmdir/rmdir.c | 11 |
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); } } |