zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Guillaume Chazarain <guichaz@yahoo.fr>,
	"Zsh Hackers' List" <zsh-workers@sunsite.dk>
Subject: Re: deadlock caused by gettext usage in a signal handler
Date: Fri, 07 Dec 2007 11:27:12 +0000	[thread overview]
Message-ID: <200712071127.lB7BRC1F012713@news01.csr.com> (raw)
In-Reply-To: <071207032122.ZM25420@torch.brasslantern.com>

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@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  reply	other threads:[~2007-12-07 11:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30 19:35 Guillaume Chazarain
2007-12-03 22:43 ` Peter Stephenson
2007-12-04  1:39   ` Paul Ackersviller
2007-12-04 18:02   ` Guillaume Chazarain
2007-12-04 18:24     ` Peter Stephenson
2007-12-04 18:43       ` Guillaume Chazarain
2007-12-04 19:43         ` Peter Stephenson
2007-12-04 19:49           ` Guillaume Chazarain
2007-12-04 20:30 ` Peter Stephenson
2007-12-04 23:09   ` Guillaume Chazarain
2007-12-06 23:02   ` Guillaume Chazarain
2007-12-07 10:35     ` Peter Stephenson
2007-12-07 10:46       ` Guillaume Chazarain
2007-12-07 11:21         ` Bart Schaefer
2007-12-07 11:27           ` Peter Stephenson [this message]
2007-12-07 11:57             ` Guillaume Chazarain
2007-12-07 11:29         ` Peter Stephenson
2007-12-10  0:11 Paul Ackersviller
2007-12-10  2:04 ` Bart Schaefer
2007-12-10  3:17   ` Paul Ackersviller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200712071127.lB7BRC1F012713@news01.csr.com \
    --to=pws@csr.com \
    --cc=guichaz@yahoo.fr \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).