summaryrefslogtreecommitdiff
path: root/archival/bbunzip.c
diff options
context:
space:
mode:
authorDenys Vlasenko2009-10-05 03:03:07 +0200
committerDenys Vlasenko2009-10-05 03:03:07 +0200
commitdcd27abcc4471ac04d7f196905907eb9a28bf0d8 (patch)
tree24ed60e8325dcfccc99b36b5cab663cd693f29bf /archival/bbunzip.c
parentbe168b119750beacc0d0212607c6fa3ee87f238c (diff)
downloadbusybox-dcd27abcc4471ac04d7f196905907eb9a28bf0d8.zip
busybox-dcd27abcc4471ac04d7f196905907eb9a28bf0d8.tar.gz
unpackers: check errors from close() too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/bbunzip.c')
-rw-r--r--archival/bbunzip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index d25f509..d6625e4 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -98,6 +98,7 @@ int FAST_FUNC bbunpack(char **argv,
status = unpacker(&info);
if (status < 0)
exitcode = 1;
+ xclose(STDOUT_FILENO); /* with error check! */
if (filename) {
char *del = new_name;
@@ -108,12 +109,11 @@ int FAST_FUNC bbunpack(char **argv,
times.actime = info.mtime;
times.modtime = info.mtime;
- /* Close first.
+ /* Note: we closed it first.
* On some systems calling utime
- * then closing resets the mtime. */
- close(STDOUT_FILENO);
- /* Ignoring errors */
- utime(new_name, &times);
+ * then closing resets the mtime
+ * back to current time. */
+ utime(new_name, &times); /* ignoring errors */
}
/* Delete _compressed_ file */