Subject: Re: CVS commit: src/bin/sh (trap.c:1.32)
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 07/15/2005 16:26:51
In article <20050715040712.GM7670@che.ojctech.com>,
David Young  <dyoung@pobox.com> wrote:
>On Fri, Jul 15, 2005 at 02:32:52AM +0000, Geoff Wing wrote:
>> Christos Zoulas <christos@astron.com> typed:
>> : In article <slrndd6hhq.rr.mason@g.primenet.com.au>,
>> : Geoff Wing  <mason@primenet.com.au> wrote:
>> :>Christos Zoulas <christos@netbsd.org> typed:
>> :>: Modified Files:
>> :>: 	src/bin/sh: trap.c
>> :>: Log Message:
>> :>: Don't hard ignore signals that were ignored by our environment, because
>> :>: when we try to set a trap on them it will not work. Also while I am here:
>> 
>> I think this will need to be dependent upon whether or not we're an
>> interactive shell.  Scanning through an old POSIX document I have lying
>> around:
>> 
>> 3.14.13  trap ...
>> ...
>>  Signals that were ignored on entry to a noninteractive shell cannot be
>>  trapped or reset, although no error need be reported when attempting to
>>  do so.  An interactive shell may reset or catch signals ignored on entry.
>
>Clearly this contradicts the behaviors I suggested in my immediately
>previous email.  Too bad for me, I guess.

But the other shells seem to do it. Try running your script with ksh or
bash.

christos