diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-03 13:08:58 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-03 13:08:58 +0100 |
commit | 327d2885ecab7fb8e876026c428c2e415c5742c1 (patch) | |
tree | 7c26aa4148ed77a776ec728f919d0d0b064fbd5a | |
parent | 7b276fc17594b89040f1eda054858860c1dc1522 (diff) | |
download | busybox-w32-327d2885ecab7fb8e876026c428c2e415c5742c1.tar.gz busybox-w32-327d2885ecab7fb8e876026c428c2e415c5742c1.tar.bz2 busybox-w32-327d2885ecab7fb8e876026c428c2e415c5742c1.zip |
kill[all[5]],pkill: make signal list show signal numbers, and show RTMIN/MAX
function old new delta
print_signames 31 64 +33
signals 224 231 +7
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | libbb/u_signal_names.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c index 93cebe2fb..8c78f5e20 100644 --- a/libbb/u_signal_names.c +++ b/libbb/u_signal_names.c | |||
@@ -124,6 +124,16 @@ static const char signals[][7] = { | |||
124 | #ifdef SIGSYS | 124 | #ifdef SIGSYS |
125 | [SIGSYS ] = "SYS", | 125 | [SIGSYS ] = "SYS", |
126 | #endif | 126 | #endif |
127 | #if ENABLE_FEATURE_RTMINMAX | ||
128 | # ifdef __SIGRTMIN | ||
129 | [__SIGRTMIN] = "RTMIN", | ||
130 | # endif | ||
131 | // This makes array about x2 bigger. | ||
132 | // More compact approach is to special-case SIGRTMAX in print_signames() | ||
133 | //# ifdef __SIGRTMAX | ||
134 | // [__SIGRTMAX] = "RTMAX", | ||
135 | //# endif | ||
136 | #endif | ||
127 | }; | 137 | }; |
128 | 138 | ||
129 | // Convert signal name to number. | 139 | // Convert signal name to number. |
@@ -216,6 +226,11 @@ void FAST_FUNC print_signames(void) | |||
216 | for (signo = 1; signo < ARRAY_SIZE(signals); signo++) { | 226 | for (signo = 1; signo < ARRAY_SIZE(signals); signo++) { |
217 | const char *name = signals[signo]; | 227 | const char *name = signals[signo]; |
218 | if (name[0]) | 228 | if (name[0]) |
219 | puts(name); | 229 | printf("%2u) %s\n", signo, name); |
220 | } | 230 | } |
231 | #if ENABLE_FEATURE_RTMINMAX | ||
232 | # ifdef __SIGRTMAX | ||
233 | printf("%2u) %s\n", __SIGRTMAX, "RTMAX"); | ||
234 | # endif | ||
235 | #endif | ||
221 | } | 236 | } |