diff options
author | Bart Schaefer <schaefer@ipost.com> | 2021-05-16 19:51:11 -0700 |
---|---|---|
committer | Bart Schaefer <schaefer@ipost.com> | 2021-05-16 19:51:11 -0700 |
commit | cf5c4828d1cdfd79e369a6b3323466bc961851c4 (patch) | |
tree | 5eaf375db11852b23df617ae0a64895e262ec2f2 /Src/signals.c | |
parent | 93b4ee524df9cee5886785e9a36596af872f95f7 (diff) | |
download | zsh-cf5c4828d1cdfd79e369a6b3323466bc961851c4.tar.gz zsh-cf5c4828d1cdfd79e369a6b3323466bc961851c4.zip |
48857: declare "volatile" all globals that may be modified by signal handlers
Diffstat (limited to 'Src/signals.c')
-rw-r--r-- | Src/signals.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Src/signals.c b/Src/signals.c index 4adf03202..2c540f38f 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]; @@ -672,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); } @@ -1266,19 +1266,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. |