summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2021-03-13 11:36:31 +0000
committersthen <sthen@openbsd.org>2021-03-13 11:36:31 +0000
commit1e951bc74f37e2a31bd8d58d5384b9915f87ec21 (patch)
treeb65bfcba5f3fc05bf2056dade25cb392dd2b602e
parentWe can use memory marked as EfiBootServicesCode or EfiBootServicesData (diff)
downloadwireguard-openbsd-1e951bc74f37e2a31bd8d58d5384b9915f87ec21.tar.xz
wireguard-openbsd-1e951bc74f37e2a31bd8d58d5384b9915f87ec21.zip
only try to set timestamps on files; avoids error with ftp -o /dev/null
ok jca robert
-rw-r--r--usr.bin/ftp/fetch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 4b8b6d5c85d..b50040dad7c 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.202 2021/02/25 20:51:55 naddy Exp $ */
+/* $OpenBSD: fetch.c,v 1.203 2021/03/13 11:36:31 sthen Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -1142,7 +1142,8 @@ cleanup_url_get:
ftp_close(&fin, &tls, &fd);
if (out >= 0 && out != fileno(stdout)) {
#ifndef SMALL
- if (server_timestamps && lmt.tm_zone != 0) {
+ if (server_timestamps && lmt.tm_zone != 0 &&
+ fstat(out, &stbuf) == 0 && S_ISREG(stbuf.st_mode) != 0) {
ts[0].tv_nsec = UTIME_NOW;
ts[1].tv_nsec = 0;
setenv("TZ", lmt.tm_zone, 1);