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
This commit is contained in:
Dag-Erling Smørgrav 2002-02-16 14:02:57 +00:00
parent 911eb59369
commit 8e7cf3debf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90729

View File

@ -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? */