aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-02-20 20:38:07 +0000
committerRon Yorston <rmy@pobox.com>2020-02-21 08:40:11 +0000
commit896d625cc9e03a726d535da18539602763769d3b (patch)
treea39e4da0f7cf86fd6a24a9435372f73e4a40e79c /shell
parentff83afd9da03a9dbc16a403c542bb60008da4815 (diff)
downloadbusybox-w32-896d625cc9e03a726d535da18539602763769d3b.tar.gz
busybox-w32-896d625cc9e03a726d535da18539602763769d3b.tar.bz2
busybox-w32-896d625cc9e03a726d535da18539602763769d3b.zip
ash: remove unused signal handling variables
got_sigchld and pending_sig serve no purpose on Microsoft Windows. Saves 64 bytes.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 96dab9a81..cd15d44a6 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -529,8 +529,10 @@ struct globals_misc {
529 529
530 volatile int suppress_int; /* counter */ 530 volatile int suppress_int; /* counter */
531 volatile /*sig_atomic_t*/ smallint pending_int; /* 1 = got SIGINT */ 531 volatile /*sig_atomic_t*/ smallint pending_int; /* 1 = got SIGINT */
532#if !ENABLE_PLATFORM_MINGW32
532 volatile /*sig_atomic_t*/ smallint got_sigchld; /* 1 = got SIGCHLD */ 533 volatile /*sig_atomic_t*/ smallint got_sigchld; /* 1 = got SIGCHLD */
533 volatile /*sig_atomic_t*/ smallint pending_sig; /* last pending signal */ 534 volatile /*sig_atomic_t*/ smallint pending_sig; /* last pending signal */
535#endif
534 smallint exception_type; /* kind of exception (0..5) */ 536 smallint exception_type; /* kind of exception (0..5) */
535 /* exceptions */ 537 /* exceptions */
536#define EXINT 0 /* SIGINT received */ 538#define EXINT 0 /* SIGINT received */
@@ -642,8 +644,11 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc;
642#define backgndpid (G_misc.backgndpid ) 644#define backgndpid (G_misc.backgndpid )
643 645
644#if ENABLE_PLATFORM_MINGW32 646#if ENABLE_PLATFORM_MINGW32
647#undef got_sigchld
648#undef pending_sig
645#undef may_have_traps 649#undef may_have_traps
646#undef trap_ptr 650#undef trap_ptr
651#define pending_sig (0)
647#define may_have_traps (0) 652#define may_have_traps (0)
648#define trap_ptr trap 653#define trap_ptr trap
649#endif 654#endif
@@ -4963,15 +4968,18 @@ dowait(int block, struct job *jp)
4963{ 4968{
4964#if !ENABLE_PLATFORM_MINGW32 4969#if !ENABLE_PLATFORM_MINGW32
4965 int pid = block == DOWAIT_NONBLOCK ? got_sigchld : 1; 4970 int pid = block == DOWAIT_NONBLOCK ? got_sigchld : 1;
4966#else
4967 int pid = 1;
4968#endif
4969 4971
4970 while (jp ? jp->state == JOBRUNNING : pid > 0) { 4972 while (jp ? jp->state == JOBRUNNING : pid > 0) {
4971 if (!jp) 4973 if (!jp)
4972 got_sigchld = 0; 4974 got_sigchld = 0;
4973 pid = waitone(block, jp); 4975 pid = waitone(block, jp);
4974 } 4976 }
4977#else
4978 int pid = 1;
4979
4980 while (jp ? jp->state == JOBRUNNING : pid > 0)
4981 pid = waitone(block, jp);
4982#endif
4975 4983
4976 return pid; 4984 return pid;
4977} 4985}