zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Possible signal handling issues
Date: Thu, 2 Jan 2014 22:53:36 +0000	[thread overview]
Message-ID: <20140102225336.2fa58a39@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20140102224031.1f175f26@pws-pc.ntlworld.com>

On Thu, 2 Jan 2014 22:40:31 +0000
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
>...
> TRAPINT() { set -x; kill -INT $$; }
>...
> I further note that if I run sleep 20 normally in the foreground
> (without the sleep in the trap) I get:
> 
> TRAPINT:0:> kill -INT 25339
> TRAPINT:0:> kill -INT 25339
> 
> exactly twice.

Just to finish off this train of thought:  I'm sure Bart remembers this,
but it's worth reminding home viewers that if TRAPINT returns status
0, which it usually will with then kill last, then the job controller assumes
the signal was already handled, so doesn't take any action to pass the
signal on to the job itself.  If I add "return 1" to the end of
TRAPINT() I only ever see the output once before the job ends.

I think I've now lost interest in this...

pws


  reply	other threads:[~2014-01-02 22:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28 23:02 Bart Schaefer
2014-01-02 21:55 ` Peter Stephenson
2014-01-02 22:40   ` Peter Stephenson
2014-01-02 22:53     ` Peter Stephenson [this message]
2014-01-03  7:52       ` Bart Schaefer
2014-01-03 17:44         ` 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=20140102225336.2fa58a39@pws-pc.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).