summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-09-02 09:48:34 +0000
committerdes <des@FreeBSD.org>2000-09-02 09:48:34 +0000
commit10398016b877248cd4472759d3414effd480b3d7 (patch)
treedc29af8412c16cb771e7586d29f6f2c4a9f4096b /usr.bin/fetch
parent868b20c6a8272259ebea281d9e2a02ef98c2bee4 (diff)
downloadFreeBSD-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')
-rw-r--r--usr.bin/fetch/fetch.c3
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);
OpenPOWER on IntegriCloud