From: Wayne Davison Date: Mon, 21 Feb 2005 00:38:15 +0000 (+0000) Subject: Reposition log_open() and log_close(). X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/4a239e98f621bc180b6dbd919453296c7d1940f3 Reposition log_open() and log_close(). --- diff --git a/log.c b/log.c index aa1784af..c96ce906 100644 --- 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)