Re: [PATCH] git-daemon: fix for rotating logs
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> With rotating logs, there is a problem when the syslog is opened only once
> (in the beginning). So open the log everytime we write something, and
> close it directly after writing.
Gaah, this is ugly.
Is this something all the daemons need to deal with?
Show 13 quoted lines
> diff --git a/daemon.c b/daemon.c
> index 2b4a6f1..a887c72 100644
> --- a/daemon.c
> +++ b/daemon.c
> @@ -90,7 +90,9 @@ static void logreport(int priority, const char *err, va_list params)
> msglen = vsnprintf(buf + buflen, maxlen, err, params);
>
> if (log_syslog) {
> + openlog("git-daemon", 0, LOG_DAEMON);
> syslog(priority, "%s", buf);
> + closelog();
> return;
> }