From 3db1aef04eca0c3ef6edf0e07e930fbc25676eae Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 7 Nov 1999 08:38:50 +0000 Subject: (remove_parents): Use the correct test (same as in main) in handling --ignore-fail-on-non-empty. From Michael Stone. --- src/rmdir.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/rmdir.c') 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; } -- cgit v1.2.3-54-g00ecf