bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] trap -p does not display ignored signals inherited from pare


From: Siddhesh Poyarekar
Subject: Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process
Date: Fri, 26 Mar 2010 11:20:53 +0530

On Fri, Mar 26, 2010 at 2:40 AM, Eric Blake <eblake@redhat.com> wrote:
> Yes.  POSIX requires this for non-interactive shells, and does not
> forbid it for interactive shells.  Technically, this code could be
> modified to exempt interactive shells from hard-ignores, or left as is
> by treating both classes of shells identically in keeping things
> hard-ignored; either approach still meets POSIX.
>

The code does explicitly hard ignore signals ignored when entering a
non-interactive shell; see initialize_terminating_signals() in sig.c.
The problem is that in addition to this, it ends up doing a hard
ignore for the special signals in GETORIGSIG() -- not for all
terminating signals, just the special signals.

I know POSIX does not say anything about it, but neither does the man
page. The result of this is confusing behaviour. It should either hard
ignore _all_ signals or none. I really don't see any reason for a hard
ignore for special signals via GETORIGSIG when we already have the
stuff in place in initialize_terminating_signals() that does the right
thing.

What's more, BeOS gets special treatment in all this; its hard ignore
flag is removed after GETORIGSIG() for SIGINT because BeOS sets SIGINT
to SIG_IGN by default:

#if defined (__BEOS__)
  /* BeOS sets SIGINT to SIG_IGN! */
  original_signals[SIGINT] = SIG_DFL;
  sigmodes[SIGINT] &= ~SIG_HARD_IGNORE;
#endif


-- 
Siddhesh Poyarekar
http://siddhesh.in




reply via email to

[Prev in Thread] Current Thread [Next in Thread]