Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why does zsh un-ignores SIGQUIT?
- X-seq: zsh-workers 44248
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Why does zsh un-ignores SIGQUIT?
- Date: Wed, 24 Apr 2019 17:13:51 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1556122432; bh=4fi+pcYeZBz7lSNBQdnHqMAcvLi1Jae2tPAEjrv3TYY=; h=Subject:From:To:Date:In-Reply-To:References; b=Tz7QH8laccaav0OP7BhCWyAZwfgsUpCF8veax9RPk/kwDxCe00cja2W7kLoA2eW+7 +A4Np+CtTItvMadYOJC7NaPTfxNhbsNvEluaGi3rigEA5tp0cAOGkgpTHJA5zKusCl phePBNEu3JL2co+mLGb4qJcGSWb9+TIL04L5I93VNkdLFx6zqPOCJXF7HIYR1aBA32 u52TQIi2zLbEBgDjM4revMhdAycymKaJU6kS/UHqzPPREL8ChUvYHEoEdBaTXhuQN/ af/9lSlhxWO/fT6aqtSsnRmO16CdPdlCqr8GeLuUeBE5b3FZRWEc1UEku8mtN0bGAW +HKdUdR1SuxyQ==
- In-reply-to: <20190424081314.bijg2xmore4bro2v@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author