summaryrefslogtreecommitdiff
path: root/Src/signals.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/Src/signals.c b/Src/signals.c
index 96ff9e9b3..5c787e2a8 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -53,7 +53,7 @@ mod_export Eprog siglists[VSIGCOUNT];
/* Total count of trapped signals */
/**/
-mod_export int nsigtrapped;
+mod_export volatile int nsigtrapped;
/* Running an exit trap? */
@@ -72,20 +72,20 @@ static int exit_trap_posix;
/* Variables used by signal queueing */
/**/
-mod_export int queueing_enabled, queue_front, queue_rear;
+mod_export volatile int queueing_enabled, queue_front, queue_rear;
/**/
mod_export int signal_queue[MAX_QUEUE_SIZE];
/**/
mod_export sigset_t signal_mask_queue[MAX_QUEUE_SIZE];
#ifdef DEBUG
/**/
-mod_export int queue_in;
+mod_export volatile int queue_in;
#endif
/* Variables used by trap queueing */
/**/
-mod_export int trap_queueing_enabled, trap_queue_front, trap_queue_rear;
+mod_export volatile int trap_queueing_enabled, trap_queue_front, trap_queue_rear;
/**/
mod_export int trap_queue[MAX_QUEUE_SIZE];
@@ -539,7 +539,8 @@ wait_for_processes(void)
#endif
if (WIFEXITED(status) &&
pn->pid == jn->gleader &&
- killpg(pn->pid, 0) == -1) {
+ killpg(pn->pid, 0) == -1 &&
+ errno == ESRCH) {
if (last_attached_pgrp == jn->gleader &&
!(jn->stat & STAT_NOSTTY)) {
/*
@@ -671,9 +672,9 @@ zhandler(int sig)
if ((isset(PRIVILEGED) || isset(RESTRICTED)) &&
isset(INTERACTIVE) && (noerrexit & NOERREXIT_SIGNAL))
zexit(SIGINT, ZEXIT_SIGNAL);
+ errflag |= ERRFLAG_INT;
if (list_pipe || chline || simple_pline) {
breaks = loops;
- errflag |= ERRFLAG_INT;
inerrflush();
check_cursh_sig(SIGINT);
}
@@ -809,6 +810,7 @@ killjb(Job jn, int sig)
err = killpg(jn->gleader, sig);
if (sig == SIGCONT && err != -1)
makerunning(jn);
+ return err;
}
}
for (pn = jn->procs; pn; pn = pn->next) {
@@ -1265,19 +1267,19 @@ unqueue_traps(void)
/* Are we already executing a trap? */
/**/
-int intrap;
+volatile int intrap;
/* Is the current trap a function? */
/**/
-int trapisfunc;
+volatile int trapisfunc;
/*
* If the current trap is not a function, at what function depth
* did the trap get called?
*/
/**/
-int traplocallevel;
+volatile int traplocallevel;
/*
* sig is the signal number.