Commit 27d3cdbc authored by Andrew Tridgell's avatar Andrew Tridgell

syslog support in rsync daemon has been broken since I added the "log

file" option. I wonder why noone reported it? Or did everyone just use
"log file" ?
parent 10600500
......@@ -51,8 +51,12 @@ void exit_cleanup(int code)
if (code) {
kill_all(SIGUSR1);
}
if ((cleanup_pid != 0) && (cleanup_pid == (int) getpid()))
unlink(lp_pid_file());
if ((cleanup_pid != 0) && (cleanup_pid == (int) getpid())) {
char *pidf = lp_pid_file();
if (pidf && *pidf) {
unlink(lp_pid_file());
}
}
exit(code);
}
......
......@@ -353,7 +353,7 @@ static int start_daemon(int fd)
io_printf(fd,"@RSYNCD: %d\n", PROTOCOL_VERSION);
motd = lp_motd_file();
if (*motd) {
if (motd && *motd) {
FILE *f = fopen(motd,"r");
while (f && !feof(f)) {
int len = fread(line, 1, sizeof(line)-1, f);
......
......@@ -63,12 +63,14 @@ void log_open(void)
static int initialised;
int options = LOG_PID;
time_t t;
char *logf;
if (initialised) return;
initialised = 1;
if (lp_log_file()) {
logfile = fopen(lp_log_file(), "a");
logf = lp_log_file();
if (logf && *logf) {
logfile = fopen(logf, "a");
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment