aboutsummaryrefslogtreecommitdiff
path: root/archival/bbunzip.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-11-14 23:35:00 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-11-14 23:35:00 +0100
commitcc8b6871a71e42a3e0bdb79e534b90cc3eb4c8e6 (patch)
tree8d3ee118d6a5dd962be5fa30812e255f39a6cfa5 /archival/bbunzip.c
parente3600a042e80cf279cfcb7f4c5e5f236b02bba7a (diff)
downloadbusybox-cc8b6871a71e42a3e0bdb79e534b90cc3eb4c8e6.tar.gz
use utimes() rather than obsolescent utime()
utime is obsolescent in POSIX.1-2008, use utimes() for now. Untested. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'archival/bbunzip.c')
-rw-r--r--archival/bbunzip.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index d6625e476..f81aab81f 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -105,15 +105,13 @@ int FAST_FUNC bbunpack(char **argv,
if (status >= 0) {
/* TODO: restore other things? */
if (info.mtime) {
- struct utimbuf times;
-
- times.actime = info.mtime;
- times.modtime = info.mtime;
+ struct timeval times = {.tv_sec = info.mtime,
+ .tv_usec = 0};
/* Note: we closed it first.
* On some systems calling utime
* then closing resets the mtime
* back to current time. */
- utime(new_name, &times); /* ignoring errors */
+ utimes(new_name, &times); /* ignoring errors */
}
/* Delete _compressed_ file */