From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43821 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzCAH-0003IZ-U5 for qemu-devel@nongnu.org; Fri, 24 Sep 2010 13:34:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzCAF-0002m5-2u for qemu-devel@nongnu.org; Fri, 24 Sep 2010 13:34:28 -0400 Received: from duck.dooz.org ([194.146.227.125]:46138) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzCAE-0002lc-SP for qemu-devel@nongnu.org; Fri, 24 Sep 2010 13:34:27 -0400 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Fri, 24 Sep 2010 19:34:18 +0200 Message-Id: <1285349658-3122-1-git-send-email-loic.minier@linaro.org> Subject: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler 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?= When configure runs "exit 1", the trap handler is run to cleanup any files created by configure, but this trap handler itself calls "exit" with no argument (which means zero exit code): [...] + echo Error: zlib check failed Error: zlib check failed + echo Make sure to have the zlib libs and headers installed. Make sure to have the zlib libs and headers installed. + echo + exit 1 + rm -f /tmp/qemu-conf--2779-.c /tmp/qemu-conf--2779-.o /tmp/qemu-conf--2779-.exe + exit To fix this, remove the call to exit from the trap handler, leaving it to the shell shell to exitafter the trap handler is run (honoring any previously provided exit code). --- configure | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 3bfc5e9..e0147d1 100755 --- a/configure +++ b/configure @@ -15,7 +15,7 @@ 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 +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