]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Read config after opening syslog
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 25 Aug 2011 11:29:17 +0000 (13:29 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 25 Aug 2011 12:46:16 +0000 (14:46 +0200)
main.c

diff --git a/main.c b/main.c
index ff0c0a163980761f34bc383ccf2e3cc22fb1d89f..d6d159b669c7a4abaf7d0858dc69cd372cdc4f63 100644 (file)
--- a/main.c
+++ b/main.c
@@ -303,9 +303,6 @@ int main
     }
   }
 
-  CNF_ReadFile(conf_file);
-
-#ifndef SYS_WINNT
   if (getuid() != 0) {
     /* This write to the terminal is OK, it comes before we turn into a daemon */
     fprintf(stderr,"Not superuser\n");
@@ -323,6 +320,8 @@ int main
   
   LOG(LOGS_INFO, LOGF_Main, "chronyd version %s starting", CHRONY_VERSION);
 
+  CNF_ReadFile(conf_file);
+
   /* Check whether another chronyd may already be running.  Do this after
    * forking, so that message logging goes to the right place (i.e. syslog), in
    * case this chronyd is being run from a boot script. */
@@ -335,7 +334,6 @@ int main
   /* Write our lockfile to prevent other chronyds running.  This has *GOT* to
    * be done *AFTER* the daemon-creation fork() */
   write_lockfile();
-#endif
 
   if (do_init_rtc) {
     RTC_TimePreInit();