some non-gnu compilers can't have non-const struct initializers

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-11-15 02:28:56 +01:00
parent a307af1af6
commit 389cca4b9e
4 changed files with 18 additions and 11 deletions

View File

@ -105,10 +105,12 @@ int FAST_FUNC bbunpack(char **argv,
if (status >= 0) {
/* TODO: restore other things? */
if (info.mtime) {
struct timeval times = {.tv_sec = info.mtime,
.tv_usec = 0};
struct timeval times;
times.tv_sec = info.mtime;
times.tv_usec = 0;
/* Note: we closed it first.
* On some systems calling utime
* On some systems calling utimes
* then closing resets the mtime
* back to current time. */
utimes(new_name, &times); /* ignoring errors */