git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git daemon: avoid calling syslog() from a signal handler

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 5, 2008, 07:34 UTC
Message-ID
<7vej68u6mr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0807031624020.9925@racer>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Signal handlers should never call syslog(), as that can raise signals
> of its own.
>
> Instead, call the syslog() from the master process.
Earlier parts seem to make sense but I am puzzled by these changes.
Show 18 quoted lines
> @@ -929,7 +945,8 @@ static int service_loop(int socknum, int *socklist)
>  	for (;;) {
>  		int i;
>  
> -		if (poll(pfd, socknum, -1) < 0) {
> +		i = poll(pfd, socknum, 1);
> +		if (i < 0) {
>  			if (errno != EINTR) {
>  				error("poll failed, resuming: %s",
>  				      strerror(errno));
> @@ -937,6 +954,10 @@ static int service_loop(int socknum, int *socklist)
>  			}
>  			continue;
>  		}
> +		if (i == 0) {
> +			check_dead_children();
> +			continue;
> +		}

So you will check every 1ms to see if there are new dead children, but why is this necessary?

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 6 of 13 in “Non-inetd git-daemon hangs in syslog(3)/fclose(3) if --syslog --verbose accessing non-repositories”
  1. Brian FosterJul 3, 2008
  2. Johannes SchindelinJul 3, 2008
  3. Brian FosterJul 3, 2008
  4. Johannes SchindelinJul 3, 2008
  5. git daemon: avoid calling syslog() from a signal handlerJohannes Schindelin, Jul 3, 2008
  6. Junio C HamanoJul 5, 2008
  7. Johannes SchindelinJul 5, 2008
  8. Junio C HamanoJul 5, 2008
  9. Johannes SchindelinJul 6, 2008
  10. Junio C HamanoJul 6, 2008
  11. git daemon: avoid calling syslog() from a signal handlerJohannes Schindelin, Jul 6, 2008
  12. Junio C HamanoJul 7, 2008
  13. Stephen R. van den BergJul 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.