From: Jim Meyering Date: Sun, 7 Nov 1999 08:38:50 +0000 (+0000) Subject: (remove_parents): Use the correct test X-Git-Tag: FILEUTILS-4_0j-trial~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3db1aef04eca0c3ef6edf0e07e930fbc25676eae;p=thirdparty%2Fcoreutils.git (remove_parents): Use the correct test (same as in main) in handling --ignore-fail-on-non-empty. From Michael Stone. --- diff --git a/src/rmdir.c b/src/rmdir.c index 01727b8b4d..24c5f66e33 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; }