diff options
author | Ron Yorston <rmy@pobox.com> | 2020-02-08 17:14:24 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-02-08 17:14:24 +0000 |
commit | 5f2f75d721dcf7629facd7fd366f42fec80ada21 (patch) | |
tree | c50a4584d7248cf881dc97474bb411bc64a14477 | |
parent | 8152e92d3abfff0386a672421e164ce163678dcf (diff) | |
download | busybox-w32-5f2f75d721dcf7629facd7fd366f42fec80ada21.tar.gz busybox-w32-5f2f75d721dcf7629facd7fd366f42fec80ada21.tar.bz2 busybox-w32-5f2f75d721dcf7629facd7fd366f42fec80ada21.zip |
ash: don't compile dotrap()
Since signal handling isn't functional for WIN32 there's no need
to compile dotrap(). Some elements of the globals_misc structure
can also be excluded.
Saves 144 bytes.
-rw-r--r-- | shell/ash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index f23d63b21..e032966bd 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -574,6 +574,7 @@ struct globals_misc { | |||
574 | #endif | 574 | #endif |
575 | 575 | ||
576 | /* trap handler commands */ | 576 | /* trap handler commands */ |
577 | #if !ENABLE_PLATFORM_MINGW32 | ||
577 | /* | 578 | /* |
578 | * Sigmode records the current value of the signal handlers for the various | 579 | * Sigmode records the current value of the signal handlers for the various |
579 | * modes. A value of zero means that the current handler is not known. | 580 | * modes. A value of zero means that the current handler is not known. |
@@ -587,6 +588,7 @@ struct globals_misc { | |||
587 | 588 | ||
588 | /* indicates specified signal received */ | 589 | /* indicates specified signal received */ |
589 | uint8_t gotsig[NSIG - 1]; /* offset by 1: "signal" 0 is meaningless */ | 590 | uint8_t gotsig[NSIG - 1]; /* offset by 1: "signal" 0 is meaningless */ |
591 | #endif | ||
590 | uint8_t may_have_traps; /* 0: definitely no traps are set, 1: some traps may be set */ | 592 | uint8_t may_have_traps; /* 0: definitely no traps are set, 1: some traps may be set */ |
591 | char *trap[NSIG]; | 593 | char *trap[NSIG]; |
592 | char **trap_ptr; /* used only by "trap hack" */ | 594 | char **trap_ptr; /* used only by "trap hack" */ |
@@ -9672,6 +9674,7 @@ static int funcline; /* starting line number of current function, or | |||
9672 | /* Forward decl way out to parsing code - dotrap needs it */ | 9674 | /* Forward decl way out to parsing code - dotrap needs it */ |
9673 | static int evalstring(char *s, int flags); | 9675 | static int evalstring(char *s, int flags); |
9674 | 9676 | ||
9677 | #if !ENABLE_PLATFORM_MINGW32 | ||
9675 | /* Called to execute a trap. | 9678 | /* Called to execute a trap. |
9676 | * Single callsite - at the end of evaltree(). | 9679 | * Single callsite - at the end of evaltree(). |
9677 | * If we return non-zero, evaltree raises EXEXIT exception. | 9680 | * If we return non-zero, evaltree raises EXEXIT exception. |
@@ -9720,6 +9723,9 @@ dotrap(void) | |||
9720 | exitstatus = last_status; | 9723 | exitstatus = last_status; |
9721 | TRACE(("dotrap returns\n")); | 9724 | TRACE(("dotrap returns\n")); |
9722 | } | 9725 | } |
9726 | #else | ||
9727 | # define dotrap() | ||
9728 | #endif | ||
9723 | 9729 | ||
9724 | /* forward declarations - evaluation is fairly recursive business... */ | 9730 | /* forward declarations - evaluation is fairly recursive business... */ |
9725 | static int evalloop(union node *, int); | 9731 | static int evalloop(union node *, int); |