diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-11-14 23:35:00 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-11-14 23:35:00 +0100 |
commit | cc8b6871a71e42a3e0bdb79e534b90cc3eb4c8e6 (patch) | |
tree | 8d3ee118d6a5dd962be5fa30812e255f39a6cfa5 | |
parent | e3600a042e80cf279cfcb7f4c5e5f236b02bba7a (diff) | |
download | busybox-w32-cc8b6871a71e42a3e0bdb79e534b90cc3eb4c8e6.tar.gz busybox-w32-cc8b6871a71e42a3e0bdb79e534b90cc3eb4c8e6.tar.bz2 busybox-w32-cc8b6871a71e42a3e0bdb79e534b90cc3eb4c8e6.zip |
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>
-rw-r--r-- | archival/bbunzip.c | 8 | ||||
-rw-r--r-- | include/libbb.h | 1 |
2 files changed, 3 insertions, 6 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, | |||
105 | if (status >= 0) { | 105 | if (status >= 0) { |
106 | /* TODO: restore other things? */ | 106 | /* TODO: restore other things? */ |
107 | if (info.mtime) { | 107 | if (info.mtime) { |
108 | struct utimbuf times; | 108 | struct timeval times = {.tv_sec = info.mtime, |
109 | 109 | .tv_usec = 0}; | |
110 | times.actime = info.mtime; | ||
111 | times.modtime = info.mtime; | ||
112 | /* Note: we closed it first. | 110 | /* Note: we closed it first. |
113 | * On some systems calling utime | 111 | * On some systems calling utime |
114 | * then closing resets the mtime | 112 | * then closing resets the mtime |
115 | * back to current time. */ | 113 | * back to current time. */ |
116 | utime(new_name, ×); /* ignoring errors */ | 114 | utimes(new_name, ×); /* ignoring errors */ |
117 | } | 115 | } |
118 | 116 | ||
119 | /* Delete _compressed_ file */ | 117 | /* Delete _compressed_ file */ |
diff --git a/include/libbb.h b/include/libbb.h index 0f8973d9e..89d7a7b1b 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <termios.h> | 40 | #include <termios.h> |
41 | #include <time.h> | 41 | #include <time.h> |
42 | #include <unistd.h> | 42 | #include <unistd.h> |
43 | #include <utime.h> | ||
44 | /* Try to pull in PATH_MAX */ | 43 | /* Try to pull in PATH_MAX */ |
45 | #include <limits.h> | 44 | #include <limits.h> |
46 | #include <sys/param.h> | 45 | #include <sys/param.h> |