All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Altmanninger <aclopte@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jilles Tjoelker <jilles@stack.nl>,
	harald@gigawatt.nl, dash@vger.kernel.org
Subject: Re: [PATCH v3] Allow trap to un-ignore SIGINT/SIGQUIT in async subshells
Date: Sat, 18 May 2024 10:43:12 +0200	[thread overview]
Message-ID: <ZkhqIFR3mUyaXpN2@gmail.com> (raw)
In-Reply-To: <ZhKBHMHJRJdTdsVP@gondor.apana.org.au>

On Sun, Apr 07, 2024 at 07:18:52PM +0800, Herbert Xu wrote:
> On Fri, Mar 29, 2024 at 04:39:01PM +0100, Johannes Altmanninger wrote:
> >
> > diff --git a/src/trap.c b/src/trap.c
> > index cd84814..dbf81ea 100644
> > --- a/src/trap.c
> > +++ b/src/trap.c
> > @@ -272,7 +272,7 @@ ignoresig(int signo)
> >  		signal(signo, SIG_IGN);
> >  	}
> >  	if (!vforked)
> > -		sigmode[signo - 1] = S_HARD_IGN;
> > +		sigmode[signo - 1] = S_IGN;
> 
> This is buggy if sigmode is already S_HARD_IGN.  You can fix
> this by moving the if statement inside the previous one.
> 
> Please also add a comment stating that sigmode has already been
> initialised by setinteractive, as otherwise we may also lose a
> hard ignore.

I'm not really following the last part;
maybe it's no longer relevant with the bug fix.
Note that it works the same whether "set -i" or "trap - INT" is used,
also in noninteractive shells like

	dash -c '( trap - INT; sleep inf ) & read _'

  parent reply	other threads:[~2024-05-18  8:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 11:01 [RFC PATCH] Allow trap to override permanently-ignored signals in background shells Johannes Altmanninger
2024-03-08 11:48 ` Harald van Dijk
2024-03-29 11:24   ` [PATCH v2] Allow trap to un-ignore SIGINT in asynchronous subshells Johannes Altmanninger
2024-03-29 13:50     ` Jilles Tjoelker
2024-03-29 15:02       ` Johannes Altmanninger
2024-03-29 15:39         ` [PATCH v3] Allow trap to un-ignore SIGINT/SIGQUIT in async subshells Johannes Altmanninger
2024-04-07 11:18           ` Herbert Xu
2024-05-18  8:38             ` [PATCH v4] " Johannes Altmanninger
2024-05-26 10:27               ` Herbert Xu
2024-05-18  8:43             ` Johannes Altmanninger [this message]
2024-05-18  9:02               ` [PATCH v3] " Herbert Xu

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=ZkhqIFR3mUyaXpN2@gmail.com \
    --to=aclopte@gmail.com \
    --cc=dash@vger.kernel.org \
    --cc=harald@gigawatt.nl \
    --cc=herbert@gondor.apana.org.au \
    --cc=jilles@stack.nl \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.