diff options
author | des <des@FreeBSD.org> | 2000-09-02 09:48:34 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2000-09-02 09:48:34 +0000 |
commit | 10398016b877248cd4472759d3414effd480b3d7 (patch) | |
tree | dc29af8412c16cb771e7586d29f6f2c4a9f4096b /usr.bin/fetch/fetch.c | |
parent | 868b20c6a8272259ebea281d9e2a02ef98c2bee4 (diff) | |
download | FreeBSD-src-10398016b877248cd4472759d3414effd480b3d7.zip FreeBSD-src-10398016b877248cd4472759d3414effd480b3d7.tar.gz |
Don't try to set the mtime of the output file if it's not a regular file.
Pointed out by: cwt
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r-- | usr.bin/fetch/fetch.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index d72814b..b33fb03 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -385,7 +385,8 @@ fetch(char *URL, char *path) stat_end(&xs); /* Set mtime of local file */ - if (!n_flag && us.mtime && !o_stdout) { + if (!n_flag && us.mtime && !o_stdout + && (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) { struct timeval tv[2]; fflush(of); |