diff --git a/src/chcon.c b/src/chcon.c index 531ed7a0d..83d0583f8 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 aeefcc65a..0688979df 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 eb349049e..82e96442a 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 24ed5e639..16a7b9b3e 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;