From dcbfaba264df2f9f07e53f77e8178f5bfc7ae88e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 29 Nov 2009 19:40:36 +0100 Subject: fix improper utimes usage Signed-off-by: Denys Vlasenko --- archival/bbunzip.c | 8 ++++---- archival/libunarchive/data_extract_all.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'archival') diff --git a/archival/bbunzip.c b/archival/bbunzip.c index 22a0fd1..df674bc 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c @@ -105,15 +105,15 @@ int FAST_FUNC bbunpack(char **argv, if (status >= 0) { /* TODO: restore other things? */ if (info.mtime) { - struct timeval times; + struct timeval times[2]; - times.tv_sec = info.mtime; - times.tv_usec = 0; + times[1].tv_sec = times[0].tv_sec = info.mtime; + times[1].tv_usec = times[0].tv_usec = 0; /* Note: we closed it first. * On some systems calling utimes * then closing resets the mtime * back to current time. */ - utimes(new_name, ×); /* ignoring errors */ + utimes(new_name, times); /* ignoring errors */ } /* Delete _compressed_ file */ diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c index 1100410..ae242df 100644 --- a/archival/libunarchive/data_extract_all.c +++ b/archival/libunarchive/data_extract_all.c @@ -148,11 +148,11 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) } /* same for utime */ if (archive_handle->ah_flags & ARCHIVE_RESTORE_DATE) { - struct timeval t; + struct timeval t[2]; - t.tv_sec = file_header->mtime; - t.tv_usec = 0; - utimes(file_header->name, &t); + t[1].tv_sec = t[0].tv_sec = file_header->mtime; + t[1].tv_usec = t[0].tv_usec = 0; + utimes(file_header->name, t); } } } -- cgit v1.1