From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50561 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzVbO-0002Q5-Sl for qemu-devel@nongnu.org; Sat, 25 Sep 2010 10:19:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzVbN-0004Jq-GD for qemu-devel@nongnu.org; Sat, 25 Sep 2010 10:19:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63355) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzVbN-0004Jg-8l for qemu-devel@nongnu.org; Sat, 25 Sep 2010 10:19:45 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler References: <1285349658-3122-1-git-send-email-loic.minier@linaro.org> <20100925083134.GB16066@bee.dooz.org> <20100925120124.GA19083@bee.dooz.org> Date: Sat, 25 Sep 2010 16:19:35 +0200 In-Reply-To: <20100925120124.GA19083@bee.dooz.org> (=?utf-8?Q?=22Lo=C3=AFc?= Minier"'s message of "Sat, 25 Sep 2010 14:01:24 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Lo=C3=AFc?= Minier Cc: Blue Swirl , qemu-devel@nongnu.org Lo=C3=AFc Minier writes: > On Sat, Sep 25, 2010, Blue Swirl wrote: >> It looks like dash and ksh are not compliant and use the return value >> of echo or rm inside trap handler: >> dash -c 'trap "sh -c \"exit 4\"; exit" 0 1 2 3 9 11 13 15;exit 3'; echo = $? >> 4 > > I've filed https://bugs.launchpad.net/dash/+bug/647450 to track this > and forwarded the bug to dash@vger.kernel.org. > >> ksh -c 'trap "sh -c \"exit 4\"; exit" 0 1 2 3 9 11 13 15;exit 3'; echo $? >> 4 > > On my system, ksh is provided by zsh and zsh gets this right. So it's a cleanup that also works around a bug in dash. > In the mean time, could you please pull the patch in QEMU? Without > "exit" in the trap handler, the correct exit code will be returned. Would you mind resending with a more suitable commit message?