[PATCH] Defer SIGCHLD trap handler when waitchld is called from within signal handler

2012-03-06 Thread siddhesh
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale'

[PATCH] Defer SIGCHLD trap handler when waitchld is called from within the signal handler

2012-03-06 Thread Siddhesh Poyarekar
trap check_stop_child_trap SIGCHLD do_something & do_something ^d $ bash $ . foo.sh -- The above may either hang or result in a segmentation fault. Fix: The attached patch fixes this by deferring execution of the trap handler by adding it to pending_sigs. Regards, Siddhesh diff -pruN ba

Re: trap output piped to another program gives incomplete results

2010-04-09 Thread Siddhesh Poyarekar
On Sat, Apr 10, 2010 at 8:51 AM, Chet Ramey wrote: > On 3/31/10 1:45 AM, Siddhesh Poyarekar wrote: > >> Bash Version: 4.1 >> Patch Level: 2 >> Release Status: release >> >> Description: >>               When output of trap is piped to another command, say

trap output piped to another program gives incomplete results

2010-03-30 Thread Siddhesh Poyarekar
in case a trap builtin is called. In either case I suspect the fix will be quite hacky. As an aside, the same behaviour can be seen on ksh as well as csh. Only zsh seems to show the trap list correctly to the pipeline. Regards, Siddhesh -- Siddhesh Poyarekar http://siddhesh.in

Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process

2010-03-25 Thread Siddhesh Poyarekar
On Fri, Mar 26, 2010 at 11:20 AM, Siddhesh Poyarekar wrote: > 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

Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process

2010-03-25 Thread Siddhesh Poyarekar
INT 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

Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process

2010-03-25 Thread Siddhesh Poyarekar
ored. It doesn't look as though the hard ignore belongs in GETORIGSIG. -- Siddhesh Poyarekar http://siddhesh.in

Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process

2010-03-25 Thread Siddhesh Poyarekar
n to display signals that are 'not available to play with'. -- Siddhesh Poyarekar http://siddhesh.in

Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process

2010-03-23 Thread Siddhesh Poyarekar
On Tue, Mar 23, 2010 at 7:46 PM, Eric Blake wrote: > On 03/23/2010 01:29 AM, Siddhesh Poyarekar wrote: >> Steps to Reproduce: >> 1. trap '' SIGINT >> 2. exec bash >> 3. trap -p > > POSIX states: > > "Signals that were ignored on entry t

[PATCH] trap -p does not display ignored signals inherited from parent by a bash process

2010-03-23 Thread Siddhesh Poyarekar
t the signal is in fact being ignored Expected results: The list of ignored signals should be returned Additional info: Attached patch ensures that inherited ignored signals are reflected in trap_list and then subsequently displayed when trap -p is invoked. -- Siddhesh Poyarekar http://siddhesh.