From: Andrew Tridgell Date: Fri, 30 Oct 1998 11:18:38 +0000 (+0000) Subject: move the time init before the logfile opening. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/958f373550a93532a2df9c7f5242befb29f3a6e8 move the time init before the logfile opening. --- diff --git a/log.c b/log.c index d09094c6..30aca47e 100644 --- a/log.c +++ b/log.c @@ -69,6 +69,13 @@ void log_open(void) if (initialised) return; initialised = 1; + /* this looks pointless, but it is needed in order for the + C library on some systems to fetch the timezone info + before the chroot */ + t = time(NULL); + localtime(&t); + + /* optionally use a log file instead of syslog */ logf = lp_log_file(); if (logf && *logf) { logfile = fopen(logf, "a"); @@ -88,12 +95,6 @@ void log_open(void) #ifndef LOG_NDELAY logit(LOG_INFO,"rsyncd started\n"); #endif - - /* this looks pointless, but it is needed in order for the - C library on some systems to fetch the timezone info - before the chroot */ - t = time(NULL); - localtime(&t); }