Loïc Minier <l...@dooz.org> writes: > 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 d...@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.
So it's a cleanup that also works around a bug in dash. > 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. Would you mind resending with a more suitable commit message?