From 228c8e9eece21738070a986ff664f41d35b7e52e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 1 Sep 2009 11:31:14 +0200 Subject: [PATCH] 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. --- src/chcon.c | 6 ++---- src/chmod.c | 6 ++---- src/chown-core.c | 6 ++---- src/du.c | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) 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; -- 2.47.3