Received: from [140.186.70.92] (port=49466 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzQAa-0007OR-TL for qemu-devel@nongnu.org; Sat, 25 Sep 2010 04:31:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzQAW-0001hv-78 for qemu-devel@nongnu.org; Sat, 25 Sep 2010 04:31:44 -0400 Received: from duck.dooz.org ([194.146.227.125]:41746) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzQAW-0001hj-1h for qemu-devel@nongnu.org; Sat, 25 Sep 2010 04:31:40 -0400 Date: Sat, 25 Sep 2010 10:31:34 +0200 From: =?iso-8859-1?Q?Lo=EFc?= Minier Subject: Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler Message-ID: <20100925083134.GB16066@bee.dooz.org> References: <1285349658-3122-1-git-send-email-loic.minier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org On Sat, Sep 25, 2010, Markus Armbruster wrote: > This suggests the old code screws up the exit code. It doesn't for me. > Unless it does at least on some platforms, it's a cleanup, not a fix, > and the commit message should reflect that. It does screw up the exit code for me; it seems it's because dash is used as /bin/sh. If I call this shell snippet: trap "echo trap; exit" 0 1 2 3 9 11 13 15 exit 2 with dash, e.g. "dash foo.sh; echo $?", I get 0, and with bash I get 2. I'm not sure what POSIX says, but given that calling exit in a trap handler isn't needed here, I recommend including this as a bug fix. --=20 Lo=EFc Minier