qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Don't exit with zero in the trap handler
@ 2010-09-24 17:34 Loïc Minier
  2010-09-25  6:43 ` Markus Armbruster
  0 siblings, 1 reply; 10+ messages in thread
From: Loïc Minier @ 2010-09-24 17:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Loïc Minier

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-19 16:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 17:34 [Qemu-devel] [PATCH] Don't exit with zero in the trap handler Loïc Minier
2010-09-25  6:43 ` Markus Armbruster
2010-09-25  8:31   ` Loïc Minier
2010-09-25  9:01     ` Blue Swirl
2010-09-25 12:01       ` Loïc Minier
2010-09-25 14:19         ` Markus Armbruster
2010-09-25 15:30         ` Blue Swirl
2010-09-25 19:52           ` [Qemu-devel] [PATCH] Avoid exit in trap as it breaks with some shells Loïc Minier
2010-09-26  6:58             ` Blue Swirl
2014-05-19 16:30             ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).