9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] [p9p] Bug in signal handling
@ 2009-05-12 22:57 dexen deVries
  0 siblings, 0 replies; only message in thread
From: dexen deVries @ 2009-05-12 22:57 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

Hello,

Using Plan 9 Port (tip), I was having problem with an rc script running from
listen1. Exit status of external programs was not updating $status if ran
under listen1, but worked correctly when ran without listen1. Some stracing
around shows wait4()s return error in the former case, apparently because
SIGCHLD handler is set to SIG_IGN by listen1 and not updated by rc.

It seems the  function
src/lib9/notify.c:/^noteinit
does not handle SIG_IGN correctly. Attached patch attempts to solve it.


Also, this is my first post there. Hi and hello, I'm an average linux user, and
a Plan 9 fan in the making. Thank you a lot for useful software :)


Regards,

dexen

[-- Attachment #2: notify-sig-ign.patch --]
[-- Type: text/x-patch, Size: 446 bytes --]

diff -r 74392a7c323c src/lib9/notify.c
--- a/src/lib9/notify.c	Wed Mar 11 13:37:29 2009 -0700
+++ b/src/lib9/notify.c	Wed May 13 00:52:05 2009 +0200
@@ -265,7 +265,7 @@
 		 * Or maybe someone has already called notifyon/notifyoff.
 		 * Leave it alone.
 		 */
-		if(handler(sig->sig) != SIG_DFL)
+		if((handler(sig->sig) != SIG_DFL) && handler(sig->sig) != SIG_IGN)
 			continue;
 		notifyseton(sig->sig, !(sig->flags&NoNotify));
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-12 22:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 22:57 [9fans] [p9p] Bug in signal handling dexen deVries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).