[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler
From: |
Loïc Minier |
Subject: |
Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler |
Date: |
Sat, 25 Sep 2010 10:31:34 +0200 |
On Sat, Sep 25, 2010, Markus Armbruster wrote:
> This suggests the old code screws up the exit code. It doesn't for me.
> Unless it does at least on some platforms, it's a cleanup, not a fix,
> and the commit message should reflect that.
It does screw up the exit code for me; it seems it's because dash is
used as /bin/sh. If I call this shell snippet:
trap "echo trap; exit" 0 1 2 3 9 11 13 15
exit 2
with dash, e.g. "dash foo.sh; echo $?", I get 0, and with bash I get 2.
I'm not sure what POSIX says, but given that calling exit in a trap
handler isn't needed here, I recommend including this as a bug fix.
--
Loïc Minier
- [Qemu-devel] [PATCH] Don't exit with zero in the trap handler, Loïc Minier, 2010/09/24
- Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler, Markus Armbruster, 2010/09/25
- Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler,
Loïc Minier <=
- Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler, Blue Swirl, 2010/09/25
- Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler, Loïc Minier, 2010/09/25
- Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler, Markus Armbruster, 2010/09/25
- Re: [Qemu-devel] [PATCH] Don't exit with zero in the trap handler, Blue Swirl, 2010/09/25
- [Qemu-devel] [PATCH] Avoid exit in trap as it breaks with some shells, Loïc Minier, 2010/09/25
- Re: [Qemu-devel] [PATCH] Avoid exit in trap as it breaks with some shells, Blue Swirl, 2010/09/26