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

Re: [PATCH] Restore SIGCHLD to SIG_DFL where we care about waitpid().

From
Petr Baudis <pasky@suse.cz>
Date
Jun 20, 2006, 12:59 UTC
Message-ID
<20060620125936.GQ2609@pasky.or.cz>
In-Reply-To
<7vslm04j2r.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Tue, Jun 20, 2006 at 05:11:40AM CEST, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 16 quoted lines
> diff --git a/connect.c b/connect.c
> index 52d709e..db7342e 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -581,6 +581,11 @@ int git_connect(int fd[2], char *url, co
>  	enum protocol protocol = PROTO_LOCAL;
>  	int free_path = 0;
>  
> +	/* Without this we cannot rely on waitpid() to tell
> +	 * what happened to our children.
> +	 */
> +	signal(SIGCHLD, SIG_DFL);
> +
>  	host = strstr(url, "://");
>  	if(host) {
>  		*host = '\0';

It would be nice if at this point of Git development we could already think about libification when doing things like this (I'd like to do Git.pm as my little summer project this year). I'd make it part of the API that the calling application must not defer SIGCHLD, and conversely put the handler to all the main()s that reach git_connect().

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.
Previous: Junio C HamanoNext: Edgar Toernig
Message 6 of 7 in “[Q] what to do when waitpid() returns ECHILD under signal(SIGCHLD, SIG_IGN)?”
  1. Junio C HamanoJun 19, 2006
  2. Linus TorvaldsJun 19, 2006
  3. Junio C HamanoJun 20, 2006
  4. Linus TorvaldsJun 20, 2006
  5. Restore SIGCHLD to SIG_DFL where we care about waitpid().Junio C Hamano, Jun 20, 2006
  6. Petr BaudisJun 20, 2006
  7. Edgar ToernigJun 20, 2006

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.