Re: [PATCH] eval: make traps work when "set -e" is enabled

2018-12-13 Thread Herbert Xu
Antonio Ospite wrote: > When "set -e" is enabled traps are not always executed, in particular > the EXIT trap is not executed when the shell exits on an unhandled > error. > > Consider the following test script: > > #!/bin/dash > > set -e > > trap 'ret=$?; echo "EXIT: $ret"' EXIT > trap

Re: [PATCH] eval: make traps work when "set -e" is enabled

2018-10-16 Thread Antonio Ospite
On Tue, 16 Oct 2018 14:09:52 +0200 Antonio Ospite wrote: [...] > I am marking the patch as RFC because I don't know the dash codebase very > well, and I might not be aware of possible drawbacks of this change. It worked > in my limited testing but that's it. > I forgot the '--rfc' option when

[PATCH] eval: make traps work when "set -e" is enabled

2018-10-16 Thread Antonio Ospite
When "set -e" is enabled traps are not always executed, in particular the EXIT trap is not executed when the shell exits on an unhandled error. Consider the following test script: #!/bin/dash set -e trap 'ret=$?; echo "EXIT: $ret"' EXIT trap 'exit 2' HUP INT QUIT PIPE TERM read