diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c index e154cc6cc..1764b43c9 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -424,7 +424,11 @@ struct globals_misc { | |||
424 | 424 | ||
425 | struct jmploc *exception_handler; | 425 | struct jmploc *exception_handler; |
426 | 426 | ||
427 | volatile int suppress_int; /* counter */ | 427 | /*volatile*/ int suppress_int; /* counter */ |
428 | /* ^^^^^^^ removed "volatile" since gcc would turn suppress_int++ into ridiculouls | ||
429 | * 3-insn sequence otherwise. | ||
430 | * We don't change suppress_int asyncronously (in a signal handler), but we do read it async. | ||
431 | */ | ||
428 | volatile /*sig_atomic_t*/ smallint pending_int; /* 1 = got SIGINT */ | 432 | volatile /*sig_atomic_t*/ smallint pending_int; /* 1 = got SIGINT */ |
429 | volatile /*sig_atomic_t*/ smallint got_sigchld; /* 1 = got SIGCHLD */ | 433 | volatile /*sig_atomic_t*/ smallint got_sigchld; /* 1 = got SIGCHLD */ |
430 | volatile /*sig_atomic_t*/ smallint pending_sig; /* last pending signal */ | 434 | volatile /*sig_atomic_t*/ smallint pending_sig; /* last pending signal */ |
@@ -717,7 +721,8 @@ int_on(void) | |||
717 | { | 721 | { |
718 | barrier(); | 722 | barrier(); |
719 | if (--suppress_int == 0 && pending_int) | 723 | if (--suppress_int == 0 && pending_int) |
720 | raise_interrupt(); | 724 | raise_interrupt(); /* does not return */ |
725 | barrier(); | ||
721 | } | 726 | } |
722 | #if DEBUG_INTONOFF | 727 | #if DEBUG_INTONOFF |
723 | # define INT_ON do { \ | 728 | # define INT_ON do { \ |
@@ -733,7 +738,8 @@ force_int_on(void) | |||
733 | barrier(); | 738 | barrier(); |
734 | suppress_int = 0; | 739 | suppress_int = 0; |
735 | if (pending_int) | 740 | if (pending_int) |
736 | raise_interrupt(); | 741 | raise_interrupt(); /* does not return */ |
742 | barrier(); | ||
737 | } | 743 | } |
738 | #define FORCE_INT_ON force_int_on() | 744 | #define FORCE_INT_ON force_int_on() |
739 | 745 | ||
@@ -743,7 +749,8 @@ force_int_on(void) | |||
743 | barrier(); \ | 749 | barrier(); \ |
744 | suppress_int = (v); \ | 750 | suppress_int = (v); \ |
745 | if (suppress_int == 0 && pending_int) \ | 751 | if (suppress_int == 0 && pending_int) \ |
746 | raise_interrupt(); \ | 752 | raise_interrupt(); /* does not return */ \ |
753 | barrier(); \ | ||
747 | } while (0) | 754 | } while (0) |
748 | 755 | ||
749 | 756 | ||