]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(remove_parents): Use the correct test
authorJim Meyering <jim@meyering.net>
Sun, 7 Nov 1999 08:38:50 +0000 (08:38 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 7 Nov 1999 08:38:50 +0000 (08:38 +0000)
(same as in main) in handling --ignore-fail-on-non-empty.
From Michael Stone.

src/rmdir.c

index 01727b8b4d247013346c750c584a31651328f27b..24c5f66e338a8262b0566631cf68ee1e3784b88c 100644 (file)
@@ -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;
        }