mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-02-01 10:42:05 -05:00
Made log_open() static and made it die with an error if the
log-file can't be opened.
This commit is contained in:
24
log.c
24
log.c
@@ -85,6 +85,20 @@ static char const *rerr_name(int code)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void logit(int priority, char *buf)
|
||||
{
|
||||
@@ -139,16 +153,6 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
void log_close(void)
|
||||
{
|
||||
if (logfile) {
|
||||
|
||||
Reference in New Issue
Block a user