From 4c0d10cd1b5a5716ef37c0b77c6255d4532b9d02 Mon Sep 17 00:00:00 2001 From: des Date: Sat, 16 Feb 2002 14:02:57 +0000 Subject: If downloading to a temporary file, set the timestamp on the temp file, not on the file we're replacing. PR: bin/34992 Submitted by: Shunichiro Ariura MFC after: 1 week --- usr.bin/fetch/fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/fetch/fetch.c') diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 6d88622..34ee02e 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -549,8 +549,8 @@ fetch(char *URL, const char *path) tv[0].tv_sec = (long)(us.atime ? us.atime : us.mtime); tv[1].tv_sec = (long)us.mtime; tv[0].tv_usec = tv[1].tv_usec = 0; - if (utimes(path, tv)) - warn("%s: utimes()", path); + if (utimes(tmppath ? tmppath : path, tv)) + warn("%s: utimes()", tmppath ? tmppath : path); } /* timed out or interrupted? */ -- cgit v1.1