Reposition log_open() and log_close().
authorWayne Davison <wayned@samba.org>
Mon, 21 Feb 2005 00:38:15 +0000 (00:38 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 21 Feb 2005 00:38:15 +0000 (00:38 +0000)
log.c

diff --git a/log.c b/log.c
index aa1784a..c96ce90 100644 (file)
--- a/log.c
+++ b/log.c
@@ -90,28 +90,6 @@ static char const *rerr_name(int code)
        return NULL;
 }
 
-void log_open(void)
-{
-       if (logfname && !logfile) {
-               extern int orig_umask;
-               int old_umask = umask(022 | orig_umask);
-               logfile = fopen(logfname, "a");
-               umask(old_umask);
-               if (!logfile) {
-                       am_daemon = 0; /* avoid trying to log again */
-                       rsyserr(FERROR, errno, "fopen() of log-file failed");
-                       exit_cleanup(RERR_FILESELECT);
-               }
-       }
-}
-
-void log_close(void)
-{
-       if (logfile) {
-               fclose(logfile);
-               logfile = NULL;
-       }
-}
 
 static void logit(int priority, char *buf)
 {
@@ -166,6 +144,29 @@ void log_init(void)
 #endif
 }
 
+void log_open(void)
+{
+       if (logfname && !logfile) {
+               extern int orig_umask;
+               int old_umask = umask(022 | orig_umask);
+               logfile = fopen(logfname, "a");
+               umask(old_umask);
+               if (!logfile) {
+                       am_daemon = 0; /* avoid trying to log again */
+                       rsyserr(FERROR, errno, "fopen() of log-file failed");
+                       exit_cleanup(RERR_FILESELECT);
+               }
+       }
+}
+
+void log_close(void)
+{
+       if (logfile) {
+               fclose(logfile);
+               logfile = NULL;
+       }
+}
+
 /* this is the underlying (unformatted) rsync debugging function. Call
  * it with FINFO, FERROR or FLOG */
 void rwrite(enum logcode code, char *buf, int len)