]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Get timezone info before being in the chroot.
authorVincent Bernat <bernat@luffy.cx>
Thu, 15 Oct 2009 10:18:45 +0000 (12:18 +0200)
committerVincent Bernat <bernat@luffy.cx>
Thu, 15 Oct 2009 10:18:45 +0000 (12:18 +0200)
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.

src/lldpd.c

index 14b07d2da77a3453b2648b0f36921680a8afcc8e..c95bd49be13e8fdfefca5392991771a55dfa4e9d 100644 (file)
@@ -828,6 +828,7 @@ lldpd_main(int argc, char *argv[])
        }
        
        log_init(debug, __progname);
+       tzset();                /* Get timezone info before chroot */
 
        if (!debug) {
                int pid;