From: Junio C Hamano Date: Mon, 28 Apr 2008 16:29:02 GMT Subject: Re: [PATCH] git-daemon: fix for rotating logs Message-ID: <7vtzhmaqpd.fsf@gitster.siamese.dyndns.org> In-Reply-To: Johannes Schindelin 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? > 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; > }