diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-15 02:28:56 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-15 02:28:56 +0100 |
commit | 389cca4b9ed07be8d873b2aae01f3eb0c3474f7c (patch) | |
tree | 4ec81672d1bd6b18578576b876659d6a257ca5ae /archival | |
parent | a307af1af62c51e33e2801d74dbc35560af0fc0e (diff) | |
download | busybox-w32-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.tar.gz busybox-w32-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.tar.bz2 busybox-w32-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.zip |
some non-gnu compilers can't have non-const struct initializers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r-- | archival/bbunzip.c | 8 | ||||
-rw-r--r-- | archival/libunarchive/data_extract_all.c | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index f81aab81f..22a0fd189 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -105,10 +105,12 @@ 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 timeval times = {.tv_sec = info.mtime, | 108 | struct timeval times; |
109 | .tv_usec = 0}; | 109 | |
110 | times.tv_sec = info.mtime; | ||
111 | times.tv_usec = 0; | ||
110 | /* Note: we closed it first. | 112 | /* Note: we closed it first. |
111 | * On some systems calling utime | 113 | * On some systems calling utimes |
112 | * then closing resets the mtime | 114 | * then closing resets the mtime |
113 | * back to current time. */ | 115 | * back to current time. */ |
114 | utimes(new_name, ×); /* ignoring errors */ | 116 | utimes(new_name, ×); /* ignoring errors */ |
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c index 889face10..294024bbb 100644 --- a/archival/libunarchive/data_extract_all.c +++ b/archival/libunarchive/data_extract_all.c | |||
@@ -143,8 +143,10 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) | |||
143 | } | 143 | } |
144 | /* same for utime */ | 144 | /* same for utime */ |
145 | if (archive_handle->ah_flags & ARCHIVE_RESTORE_DATE) { | 145 | if (archive_handle->ah_flags & ARCHIVE_RESTORE_DATE) { |
146 | struct timeval t = {.tv_sec = file_header->mtime, | 146 | struct timeval t; |
147 | .tv_usec = 0}; | 147 | |
148 | t.tv_sec = file_header->mtime; | ||
149 | t.tv_usec = 0; | ||
148 | utimes(file_header->name, &t); | 150 | utimes(file_header->name, &t); |
149 | } | 151 | } |
150 | } | 152 | } |