From 4bd3be1153b3acbc6ad84cc30338ec5b5b68b220 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 13 Oct 2001 17:53:21 +0000 Subject: Save/restore state around DEBUG trap call. --- Src/exec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index 4f2916eec..aa2e3437b 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -886,11 +886,18 @@ execlist(Estate state, int dont_change_job, int exiting) state->pc--; sublist_done: - cmdsp = csp; noerrexit = oldnoerrexit; - if (sigtrapped[SIGDEBUG]) + if (sigtrapped[SIGDEBUG]) { + exiting = donetrap; + ret = lastval; dotrap(SIGDEBUG); + lastval = ret; + donetrap = exiting; + noerrexit = oldnoerrexit; + } + + cmdsp = csp; /* Check whether we are suppressing traps/errexit * * (typically in init scripts) and if we haven't * -- cgit 1.4.1