Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: deadlock caused by gettext usage in a signal handler



Bart Schaefer wrote:
> On Dec 7, 11:46am, Guillaume Chazarain wrote:
> }
> } Ok, but I don't mind changing it to queue_signals().
> 
> I think that might be better anyway, because I'm not sure that
> sigfillset() et al. are as portable as the code that queue_signals()
> encapsulates.

That's already worked around... we use the same code Guillaume just
added in zhandler(), unconditionally.  It's fixed up by definitions in
the header.

However, it's trivial to make it consistent with other places...

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.125
diff -u -r1.125 exec.c
--- Src/exec.c	7 Dec 2007 10:33:58 -0000	1.125
+++ Src/exec.c	7 Dec 2007 11:25:54 -0000
@@ -229,7 +229,6 @@
 {
     pid_t pid;
     struct timezone dummy_tz;
-    sigset_t signals;
 
     /*
      * Is anybody willing to explain this test?
@@ -240,10 +239,9 @@
     }
     if (tv)
 	gettimeofday(tv, &dummy_tz);
-    sigfillset(&signals);
-    signals = signal_block(signals);
+    queue_signals();
     pid = fork();
-    signal_setmask(signals);
+    unqueue_signals();
     if (pid == -1) {
 	zerr("fork failed: %e", errno);
 	return -1;


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author