From: Vincent Bernat Date: Thu, 15 Oct 2009 10:18:45 +0000 (+0200) Subject: Get timezone info before being in the chroot. X-Git-Tag: 0.5.0~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4b9a5a2384c8b99352229bddc6ee2f6e69077e5b;p=thirdparty%2Flldpd.git Get timezone info before being in the chroot. Depending on the libc, first implicit call to tzset() can be done when invoking syslog() the first time. In most situation, this is done when we are in a chroot and therefore, we cannot read /etc/localtime and get an accurate timezone information. Therefore, we invoke tzset() before being in chroot. --- diff --git a/src/lldpd.c b/src/lldpd.c index 14b07d2d..c95bd49b 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -828,6 +828,7 @@ lldpd_main(int argc, char *argv[]) } log_init(debug, __progname); + tzset(); /* Get timezone info before chroot */ if (!debug) { int pid;