zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: Why does zsh un-ignores SIGQUIT?
Date: Fri, 26 Apr 2019 14:42:39 +0100	[thread overview]
Message-ID: <1556286159.6728.9.camel@samsung.com> (raw)
In-Reply-To: <20190425211704.n6urllyyfegcqxe6@chaz.gmail.com>

On Thu, 2019-04-25 at 22:17 +0100, Stephane Chazelas wrote:
> I wonder what the rationale is for why zsh will happily install a
> handler on an ignored signal but not reset to default.

I think it's simply this in the removetrap() code...

    trapped = sigtrapped[sig];
...
    if (!trapped) {
	unqueue_signals();
        return NULL;
    }

If the signal was ignored on entry, it stays ignored (because that's
down in the OS), but zsh doesn't mark it as handled specially.  So
when we get the request to unset it we execute this code, shrugging our
shoulders and doing nothing.  For SIGQUIT we now do mark it as
handled specially.

Instead of laboriously setting up records for all signals, maybe we
could add a call to set the default signal handler in the "if" above?
At worst that should have no effect, probably.

pws


  reply	other threads:[~2019-04-26 13:43 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
2019-04-25 21:17   ` Stephane Chazelas
2019-04-26 13:42     ` Peter Stephenson [this message]
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=1556286159.6728.9.camel@samsung.com \
    --to=p.stephenson@samsung.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).