From dcd27abcc4471ac04d7f196905907eb9a28bf0d8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 5 Oct 2009 03:03:07 +0200 Subject: unpackers: check errors from close() too Signed-off-by: Denys Vlasenko --- archival/bbunzip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'archival') diff --git a/archival/bbunzip.c b/archival/bbunzip.c index d25f50939..d6625e476 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, ×); + * then closing resets the mtime + * back to current time. */ + utime(new_name, ×); /* ignoring errors */ } /* Delete _compressed_ file */ -- cgit v1.2.3