summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch/fetch.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-11-13 16:04:20 +0000
committerdes <des@FreeBSD.org>2002-11-13 16:04:20 +0000
commit57b4b0e512d386c8ab6b5505af1107ccb77e2fe5 (patch)
tree313fb4aaccd4b2e8ecb8323808f25838320774a0 /usr.bin/fetch/fetch.c
parent9dde910437d4d4f8c5ef8c41b064eab5f4f26383 (diff)
downloadFreeBSD-src-57b4b0e512d386c8ab6b5505af1107ccb77e2fe5.zip
FreeBSD-src-57b4b0e512d386c8ab6b5505af1107ccb77e2fe5.tar.gz
Don't set atime / mtime if we don't have an output file, which can happen
in certain failure scenarii (mostly DNS trouble).
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-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 1cccc3a..c40b8b6 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -572,8 +572,8 @@ fetch(char *URL, const char *path)
*/
signal:
/* set mtime of local file */
- if (!n_flag && us.mtime && !o_stdout
- && (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) {
+ if (!n_flag && us.mtime && !o_stdout && of != NULL &&
+ (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) {
struct timeval tv[2];
fflush(of);
OpenPOWER on IntegriCloud