Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [Q] what to do when waitpid() returns ECHILD under signal(SIGCHLD, SIG_IGN)?

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:30


On Mon, 19 Jun 2006, Junio C Hamano wrote:
Somebody I met last week in Japan reported that the socks client
he uses to cross the firewall to connect to git:// port from his
company environment seems to do signal(SIGCHLD, SIG_IGN) before
spawning git.
Ok, that sounds pretty broken of it.
We could work this around by having signal(SIGCHLD, SIG_DFL)
upfront in git.c::main(), but I am wondering what the standard
practice for programs that use waitpid() call.
We need the status return, so failing on getting ECHILD is absolutely the 
right thing to do, because it implies that we don't know what the status 
could have been.

So we need to reset SIGCHLD back to SIG_DFL (or catch it explicitly).

Whether we want to do that in the main() routine or when we actually do 
the fork() or whatever is a different issue.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help