diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
commit | b09f4483416c54c1782824633dfabaf2ec0265b6 (patch) | |
tree | 304bc82642862525ae680c7fbaa249663b10ad57 /Src/signals.c | |
parent | 12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff) | |
parent | 6e55c920503071e917619b8cb1a188cd35d772db (diff) | |
download | zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip |
New upstream version 5.8.1.2-test
Diffstat (limited to 'Src/signals.c')
-rw-r--r-- | Src/signals.c | 20 |
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. |