zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Why does zsh un-ignores SIGQUIT?
Date: Wed, 24 Apr 2019 17:13:51 +0100	[thread overview]
Message-ID: <457ef1932f2d33314f6dee6581f7e496613125e4.camel@ntlworld.com> (raw)
In-Reply-To: <20190424081314.bijg2xmore4bro2v@chaz.gmail.com>

On Wed, 2019-04-24 at 09:13 +0100, Stephane Chazelas wrote:
> $ (trap '' QUIT; grep SigIgn /proc/self/status; ./Src/zsh -c 'grep SigIgn /proc/self/status')
> SigIgn: 0000000000000004
> SigIgn: 0000000000000000
> 
> That only seems to be happening for SIGQUIT.
> 
> (that's from the current git HEAD)

SIGQUIT is ignored internally within the shell, visible below the patched
code.  The shell knows if you've explicitly ignored SIGQUIT, but not if
it's ignored by inheritance when the shell starts.  The flag is tested
in entersubsh().

pws

diff --git a/Src/init.c b/Src/init.c
index e7e62e2f7..2d5c3296d 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1234,6 +1234,15 @@ init_signals(void)
 
     intr();
 
+#ifdef POSIX_SIGNALS
+    {
+	struct sigaction act;
+	if (!sigaction(SIGQUIT, NULL, &act) &&
+	    act.sa_handler == SIG_IGN)
+	    sigtrapped[SIGQUIT] = ZSIG_IGNORED;
+    }
+#endif
+
 #ifndef QDEBUG
     signal_ignore(SIGQUIT);
 #endif


  reply	other threads:[~2019-04-24 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24  8:13 Stephane Chazelas
2019-04-24 16:13 ` Peter Stephenson [this message]
2019-04-25 21:17   ` Stephane Chazelas
2019-04-26 13:42     ` Peter Stephenson
2019-04-26 14:03       ` Peter Stephenson

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=457ef1932f2d33314f6dee6581f7e496613125e4.camel@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /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).