move the time init before the logfile opening.
authorAndrew Tridgell <tridge@samba.org>
Fri, 30 Oct 1998 11:18:38 +0000 (11:18 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 30 Oct 1998 11:18:38 +0000 (11:18 +0000)
log.c

diff --git a/log.c b/log.c
index d09094c..30aca47 100644 (file)
--- 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);
 }