main: Only set savestatus in exitcmd

2018-05-05 Thread Herbert Xu
Currently exitcmd sets exitstatus and then savestatus if the latter was previously set. In fact, as exitcmd always raises an exception and will either end up in the setjmp call in main() or exitshell(), where exitstatus is always replaced by savestatus if set, we only need to set savestatus. Sign

Re: Regression in dash 0.5.10 related to subshells

2018-05-05 Thread Herbert Xu
Leah Neukirchen wrote: > Hi, > > as of dash 0.5.10, this script waits for the sleep to terminate before > executing the last line, which no other /bin/sh does. > dash 0.5.9.1 worked fine. > > > #!/bin/sh > sleep 3 & > echo first in main shell > ( echo in subshell; ) > echo back to main shell >

mkinit: Split reset into exitreset and reset

2018-05-05 Thread Herbert Xu
Previously reset was called after exitshell. This was changed so that it was called before exitshell because certain state needed to be reset in order for the EXIT trap to work. However, this caused issues because certain other states (such as local variables) should not be reset. This patch fix

Re: Regression in dash 0.5.10 related to subshells

2018-05-05 Thread Leah Neukirchen
Herbert Xu writes: > Leah Neukirchen wrote: >> Hi, >> >> as of dash 0.5.10, this script waits for the sleep to terminate before >> executing the last line, which no other /bin/sh does. >> dash 0.5.9.1 worked fine. >> >> >> #!/bin/sh >> sleep 3 & >> echo first in main shell >> ( echo in subshe