From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39662 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozani-0003cq-SO for qemu-devel@nongnu.org; Sat, 25 Sep 2010 15:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ozanh-0007cf-4j for qemu-devel@nongnu.org; Sat, 25 Sep 2010 15:52:50 -0400 Received: from duck.dooz.org ([194.146.227.125]:46505) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ozanh-0007c0-0A for qemu-devel@nongnu.org; Sat, 25 Sep 2010 15:52:49 -0400 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Sat, 25 Sep 2010 21:52:30 +0200 Message-Id: <1285444350-16679-1-git-send-email-loic.minier@linaro.org> In-Reply-To: References: Subject: [Qemu-devel] [PATCH] Avoid exit in trap as it breaks with some shells List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Lo=C3=AFc=20Minier?= Don't call exit in the trap handler as it causes the return code to be zero with some buggy shells (dash and pdksh at least) and is useless here anyway. --- configure | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 3bfc5e9..9d3acfc 100755 --- a/configure +++ b/configure @@ -15,7 +15,9 @@ TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c" TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o" TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe" -trap "rm -f $TMPC $TMPO $TMPE ; exit" EXIT INT QUIT TERM +# NB: do not call "exit" in the trap handler; this is buggy with some shells; +# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> +trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM compile_object() { $cc $QEMU_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null -- 1.7.1