]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Initialize tzcode early.
[tcpdump] / tcpdump.c
index a7a97fffef1bc2b6b597ed5e428c68a3c2a01f8f..a7756be5624c0322d403c7b56403da6601509dc6 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1575,6 +1575,13 @@ main(int argc, char **argv)
        if (abort_on_misalignment(ebuf, sizeof(ebuf)) < 0)
                error("%s", ebuf);
 
+       /*
+        * An explicit tzset() call is usually not needed as it happens
+        * implicitly the first time we call localtime() or mktime(),
+        * but in some cases (sandboxing, chroot) this may be too late.
+        */
+       tzset();
+
        while (
            (op = getopt_long(argc, argv, SHORTOPTS, longopts, NULL)) != -1)
                switch (op) {