diff options
author | Jim Meyering <jim@meyering.net> | 1999-11-07 08:38:50 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-11-07 08:38:50 +0000 |
commit | 3db1aef04eca0c3ef6edf0e07e930fbc25676eae (patch) | |
tree | ba1ddf444dee51bf1a6929a45a100cfefecdef91 /src/rmdir.c | |
parent | 691513e7f32a084d830d2067708d78d2899a7a77 (diff) | |
download | coreutils-3db1aef04eca0c3ef6edf0e07e930fbc25676eae.tar.xz |
(remove_parents): Use the correct test
(same as in main) in handling --ignore-fail-on-non-empty.
From Michael Stone.
Diffstat (limited to 'src/rmdir.c')
-rw-r--r-- | src/rmdir.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rmdir.c b/src/rmdir.c index 01727b8b4..24c5f66e3 100644 --- a/src/rmdir.c +++ b/src/rmdir.c @@ -101,11 +101,15 @@ remove_parents (char *path) if (fail) { - /* Give a diagnostic and set fail if not --ignore. */ - if (!ignore_fail_on_non_empty || errno != ENOTEMPTY) + /* Stop quietly if --ignore-fail-on-non-empty. */ + if (ignore_fail_on_non_empty + && (errno == ENOTEMPTY || errno == EEXIST)) + { + fail = 0; + } + else { error (0, errno, "%s", path); - fail = 1; } break; } |