]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
chcon, chmod, chgrp, chown, du: do not ignore fts_close failure
authorJim Meyering <meyering@redhat.com>
Tue, 1 Sep 2009 09:31:14 +0000 (11:31 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 1 Sep 2009 10:10:07 +0000 (12:10 +0200)
This is probably never visible, but who knows...
* src/chcon.c (process_files): Don't ignore fts_close failure.
* src/chmod.c (process_files): Likewise.
* src/chown-core.c (chown_files): Likewise.
* src/du.c (du_files): Likewise.

src/chcon.c
src/chmod.c
src/chown-core.c
src/du.c

index 531ed7a0dc4e4606d5a7614a4c1faaeb44d6f430..83d0583f8310c81eeb7edd36e3f1d1b182236b18 100644 (file)
@@ -324,10 +324,8 @@ process_files (char **files, int bit_flags)
       ok &= process_file (fts, ent);
     }
 
-  /* Ignore failure, since the only way it can do so is in failing to
-     return to the original directory, and since we're about to exit,
-     that doesn't matter.  */
-  fts_close (fts);
+  if (fts_close (fts) != 0)
+    ok = false;
 
   return ok;
 }
index aeefcc65a7a60a970e870330dbc46e60226aecc8..0688979df7eba47f2796de096e3ae89d2c0f4bc5 100644 (file)
@@ -335,10 +335,8 @@ process_files (char **files, int bit_flags)
       ok &= process_file (fts, ent);
     }
 
-  /* Ignore failure, since the only way it can do so is in failing to
-     return to the original directory, and since we're about to exit,
-     that doesn't matter.  */
-  fts_close (fts);
+  if (fts_close (fts) != 0)
+    ok = false;
 
   return ok;
 }
index eb349049eb94ddb69c16aad1d8beac9445ada1ea..82e96442a5ca2cb3269c090e4de4e484a5734524 100644 (file)
@@ -509,10 +509,8 @@ chown_files (char **files, int bit_flags,
                                required_uid, required_gid, chopt);
     }
 
-  /* Ignore failure, since the only way it can do so is in failing to
-     return to the original directory, and since we're about to exit,
-     that doesn't matter.  */
-  fts_close (fts);
+  if (fts_close (fts) != 0)
+    ok = false;
 
   return ok;
 }
index 24ed5e6397049f31a5673764c8088971f78c9ff5..16a7b9b3eca30a98a8c76f9bedb6035689ca7abe 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -642,10 +642,8 @@ du_files (char **files, int bit_flags)
           ok &= process_file (fts, ent);
         }
 
-      /* Ignore failure, since the only way it can do so is in failing to
-         return to the original directory, and since we're about to exit,
-         that doesn't matter.  */
-      fts_close (fts);
+      if (fts_close (fts) != 0)
+        ok = false;
     }
 
   return ok;