diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 12 | ||||
-rw-r--r-- | src/trap.c | 7 | ||||
-rw-r--r-- | src/trap.h | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/eval.c b/src/eval.c index b966749..ea4afc6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -304,10 +304,16 @@ setstatus: break; } out: - if ((checkexit & exitstatus) || - (pendingsigs && dotrap()) || - (flags & EV_EXIT)) + if (checkexit & exitstatus) + goto exexit; + + if (pendingsigs) + dotrap(); + + if (flags & EV_EXIT) { +exexit: exraise(EXEXIT); + } } diff --git a/src/trap.c b/src/trap.c index 7bd60ab..3d28485 100644 --- a/src/trap.c +++ b/src/trap.c @@ -309,8 +309,7 @@ onsig(int signo) * handlers while we are executing a trap handler. */ -int -dotrap(void) +void dotrap(void) { char *p; char *q; @@ -332,10 +331,8 @@ dotrap(void) evalstring(p, 0); exitstatus = savestatus; if (evalskip) - return evalskip; + break; } - - return 0; } diff --git a/src/trap.h b/src/trap.h index bdd7944..7573fd7 100644 --- a/src/trap.h +++ b/src/trap.h @@ -46,7 +46,7 @@ void clear_traps(void); void setsignal(int); void ignoresig(int); void onsig(int); -int dotrap(void); +void dotrap(void); void setinteractive(int); void exitshell(void) __attribute__((__noreturn__)); int decode_signal(const char *, int); |