diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-07-10 11:13:51 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-07-10 11:13:51 +0200 |
commit | ae351311da0d4e6642f746ae4a9c9a60f83e1e25 (patch) | |
tree | 9e8c1dfb0d7f384aa5470933bbe74c2d69d8bf09 | |
parent | 5e0411a7fb510b9aecda0a850c76bdd62c50efa4 (diff) | |
download | busybox-w32-ae351311da0d4e6642f746ae4a9c9a60f83e1e25.tar.gz busybox-w32-ae351311da0d4e6642f746ae4a9c9a60f83e1e25.tar.bz2 busybox-w32-ae351311da0d4e6642f746ae4a9c9a60f83e1e25.zip |
ash: remove "volatile" specifier from suppress_int
function old new delta
aliascmd 274 278 +4
signal_handler 81 80 -1
static.redirectsafe 144 141 -3
unwindlocalvars 219 215 -4
trapcmd 333 329 -4
setvar 164 160 -4
setpwd 167 163 -4
setinputfile 216 212 -4
setcmd 76 72 -4
readcmd 221 217 -4
raise_exception 26 22 -4
out2str 37 33 -4
out1str 32 28 -4
freejob 89 85 -4
forkchild 616 612 -4
fg_bgcmd 298 294 -4
expandarg 949 945 -4
evaltree 753 749 -4
evalsubshell 173 169 -4
evalpipe 346 342 -4
evalfun 408 404 -4
cdcmd 699 695 -4
ash_main 1240 1236 -4
__pgetc 589 585 -4
unaliascmd 152 147 -5
unalias 51 46 -5
umaskcmd 253 248 -5
stalloc 97 92 -5
shiftcmd 144 139 -5
setinputstring 73 68 -5
redirect 1068 1063 -5
recordregion 81 76 -5
pushstring 160 155 -5
popstring 120 115 -5
popstackmark 69 64 -5
popredir 123 118 -5
popfile 110 105 -5
out1fmt 45 40 -5
newline_and_flush 39 34 -5
ifsfree 66 61 -5
growstackblock 146 141 -5
freestrings 95 90 -5
fmtstr 59 54 -5
flush_stdout_stderr 23 18 -5
dowait 577 572 -5
delete_cmd_entry 52 47 -5
clearcmdentry 98 93 -5
ash_arith 79 74 -5
argstr 1404 1399 -5
evalcommand 1523 1515 -8
removerecordregions 219 209 -10
mklocal 284 274 -10
find_command 893 883 -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/52 up/down: 4/-251) Total: -247 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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 | ||