From 69c261f09e844e5b7434531614a91c30e40925da Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 3 Sep 2021 13:49:24 +0100 Subject: libbb: code shrink u_signal_names.c Reduce amount of wasted space in the signals[][] array. Saves 48 bytes. --- libbb/u_signal_names.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c index 036ad0038..ef2b6f891 100644 --- a/libbb/u_signal_names.c +++ b/libbb/u_signal_names.c @@ -31,10 +31,19 @@ # undef SIGPIPE #endif +#if ENABLE_PLATFORM_POSIX || defined(SIGSTKFLT) || defined(SIGVTALRM) +# define SIGLEN 7 +#elif defined(SIGWINCH) || (ENABLE_FEATURE_RTMINMAX && \ + !ENABLE_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS && defined(__SIGRTMIN)) +# define SIGLEN 6 +#else +# define SIGLEN 5 +#endif + /* Believe it or not, but some arches have more than 32 SIGs! * HPPA: SIGSTKFLT == 36. */ -static const char signals[][7] ALIGN1 = { +static const char signals[][SIGLEN] ALIGN1 = { // SUSv3 says kill must support these, and specifies the numerical values, // http://www.opengroup.org/onlinepubs/009695399/utilities/kill.html // {0, "EXIT"}, {1, "HUP"}, {2, "INT"}, {3, "QUIT"}, -- cgit v1.2.3-55-g6feb