Re: [PATCH] git-daemon: fix for rotating logs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> 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;
>  	}


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux