From: Jim Meyering Date: Tue, 1 Sep 2009 09:31:14 +0000 (+0200) Subject: chcon, chmod, chgrp, chown, du: do not ignore fts_close failure X-Git-Tag: v7.6~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=228c8e9eece21738070a986ff664f41d35b7e52e;p=thirdparty%2Fcoreutils.git chcon, chmod, chgrp, chown, du: do not ignore fts_close failure 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. --- diff --git a/src/chcon.c b/src/chcon.c index 531ed7a0dc..83d0583f83 100644 --- a/src/chcon.c +++ b/src/chcon.c @@ -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; } diff --git a/src/chmod.c b/src/chmod.c index aeefcc65a7..0688979df7 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -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; } diff --git a/src/chown-core.c b/src/chown-core.c index eb349049eb..82e96442a5 100644 --- a/src/chown-core.c +++ b/src/chown-core.c @@ -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; } diff --git a/src/du.c b/src/du.c index 24ed5e6397..16a7b9b3ec 100644 --- 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;