From 93e2a22482b72b3076377f71347e3dd07d7dd2f8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Dec 2020 12:23:21 +0100 Subject: shell: for signal exitcode, use 128 | sig, not 128 + sig - MIPS has signal 128 function old new delta wait_for_child_or_signal 213 214 +1 refill_HFILE_and_getc 89 88 -1 getstatus 97 96 -1 builtin_wait 339 337 -2 checkjobs 187 183 -4 process_wait_result 450 444 -6 waitcmd 290 281 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/6 up/down: 1/-23) Total: -22 bytes Signed-off-by: Denys Vlasenko --- shell/ash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shell/ash.c') diff --git a/shell/ash.c b/shell/ash.c index f4d296289..aa2a93bca 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -4610,7 +4610,7 @@ getstatus(struct job *job) job->sigint = 1; #endif } - retval += 128; + retval |= 128; } TRACE(("getstatus: job %d, nproc %d, status 0x%x, retval 0x%x\n", jobno(job), job->nprocs, status, retval)); @@ -4676,7 +4676,7 @@ waitcmd(int argc UNUSED_PARAM, char **argv) if (status != -1 && !WIFSTOPPED(status)) { retval = WEXITSTATUS(status); if (WIFSIGNALED(status)) - retval = WTERMSIG(status) + 128; + retval = 128 | WTERMSIG(status); goto ret; } } @@ -4711,7 +4711,7 @@ waitcmd(int argc UNUSED_PARAM, char **argv) ret: return retval; sigout: - retval = 128 + pending_sig; + retval = 128 | pending_sig; return retval; } -- cgit v1.2.3