X-Spam-Check-By: sourceware.org
Message-ID: <4682529E.6060107@byu.net>
Date: Wed, 27 Jun 2007 06:05:50 -0600
From: Eric Blake <ebb9@byu.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: Richard A Nelson <cowboy@linux.vnet.ibm.com>
CC: cygwin@cygwin.com
Subject: Re: Bash is broken wrt trap :(
References: <4681CDCD.7030709@linux.vnet.ibm.com> <4681DFBD.7040906@byu.net> <46820824.6000602@linux.vnet.ibm.com>
In-Reply-To: <46820824.6000602@linux.vnet.ibm.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Richard A Nelson on 6/27/2007 12:48 AM:
> OS=AIX
> bash=3.00.16(1)-release
>
> OS=Linux      << RH EL WS 4 (Nahant)
> bash=3.00.15(1)-release

Just as I suspected.  You are comparing apples to oranges.  Until you run
bash 3.2 on all machines, you can't be sure that it was an intentional
upstream change between bash 3.0 and 3.2, rather than a cygwin-specific
compilation botch.

> However, the return trap is defined to execute in the context of the
> caller, after the called function has completed...   and since all it
> does is execute
> 'false', it does cause the parents ERR trap to trigger, and things go
> pretty smoothly (on some machines).

All that man bash says is "If a sigspec is RETURN, the command arg is
executed each time a shell function or a script executed with the . or
source builtins finishes executing".  It doesn't say whether the trap is
run in the context of the function or of the caller.  This is not
cygwin-specific - you will need to take your report upstream to the bash
maintainer.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGglKd84KuGfSFAYARAm4/AJ44reipi6QeuQLXzzPaDVeEnqUWwgCcCtlo
DAnPuAhQe46y9zUNQO4vMMQ=
=ppDh
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

