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 --- libbb/copy_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libbb') diff --git a/libbb/copy_file.c b/libbb/copy_file.c index adcfe2111..893b52ed5 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -374,12 +374,12 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) /* Cannot happen: */ /* && !(flags & (FILEUTILS_MAKE_SOFTLINK|FILEUTILS_MAKE_HARDLINK)) */ ) { - struct timeval times; + struct timeval times[2]; - times.tv_sec = source_stat.st_mtime; - times.tv_usec = 0; + times[1].tv_sec = times[0].tv_sec = source_stat.st_mtime; + times[1].tv_usec = times[0].tv_usec = 0; /* BTW, utimes sets usec-precision time - just FYI */ - if (utimes(dest, ×) < 0) + if (utimes(dest, times) < 0) bb_perror_msg("can't preserve %s of '%s'", "times", dest); if (chown(dest, source_stat.st_uid, source_stat.st_gid) < 0) { source_stat.st_mode &= ~(S_ISUID | S_ISGID); -- cgit v1.2.3