summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-16 14:02:57 +0000
committerdes <des@FreeBSD.org>2002-02-16 14:02:57 +0000
commit4c0d10cd1b5a5716ef37c0b77c6255d4532b9d02 (patch)
treee2f91f77edf294240f564f7af4a65236d4604ed9 /usr.bin/fetch
parenta0ebef6b45174cb2523aeeef8c8805ccd08a1be6 (diff)
downloadFreeBSD-src-4c0d10cd1b5a5716ef37c0b77c6255d4532b9d02.zip
FreeBSD-src-4c0d10cd1b5a5716ef37c0b77c6255d4532b9d02.tar.gz
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 <syun1rou@blackshell.org> MFC after: 1 week
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/fetch.c4
1 files changed, 2 insertions, 2 deletions
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? */
OpenPOWER on IntegriCloud