summaryrefslogtreecommitdiffstats
path: root/usr.bin/file/file.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-05-29 15:58:34 +0000
committernicm <nicm@openbsd.org>2015-05-29 15:58:34 +0000
commit9dd185ad7bb0c7a2398a5bb52303197cd79497e8 (patch)
tree8176f150541f40422828d443630a19ef446d4250 /usr.bin/file/file.c
parentUse gmtime not localtime when we want UTC, I got it right in one place (diff)
downloadwireguard-openbsd-9dd185ad7bb0c7a2398a5bb52303197cd79497e8.tar.xz
wireguard-openbsd-9dd185ad7bb0c7a2398a5bb52303197cd79497e8.zip
millert points out I can just call tzset() early to avoid having to
permit access() in the child.
Diffstat (limited to 'usr.bin/file/file.c')
-rw-r--r--usr.bin/file/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/file/file.c b/usr.bin/file/file.c
index 2d65e65fbde..81294d8b791 100644
--- a/usr.bin/file/file.c
+++ b/usr.bin/file/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.43 2015/05/29 12:33:41 nicm Exp $ */
+/* $OpenBSD: file.c,v 1.44 2015/05/29 15:58:34 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <pwd.h>
#include <stdlib.h>
+#include <time.h>
#include <unistd.h>
#include "file.h"
@@ -123,6 +124,8 @@ main(int argc, char **argv)
struct input_ack *ack;
pid_t pid, parent;
+ tzset();
+
for (;;) {
opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL);
if (opt == -1)