From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58774 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzTRb-00081v-Gm for qemu-devel@nongnu.org; Sat, 25 Sep 2010 08:01:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzTRa-0002V9-8T for qemu-devel@nongnu.org; Sat, 25 Sep 2010 08:01:31 -0400 Received: from duck.dooz.org ([194.146.227.125]:34556) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzTRa-0002Uj-2u for qemu-devel@nongnu.org; Sat, 25 Sep 2010 08:01:30 -0400 Date: Sat, 25 Sep 2010 14:01:24 +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: <20100925120124.GA19083@bee.dooz.org> References: <1285349658-3122-1-git-send-email-loic.minier@linaro.org> <20100925083134.GB16066@bee.dooz.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: Blue Swirl Cc: Markus Armbruster , qemu-devel@nongnu.org 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. 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. Thanks, --=20 Lo=EFc Minier