summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2011-01-03 13:08:58 +0100
committerDenys Vlasenko2011-01-03 13:08:58 +0100
commit327d2885ecab7fb8e876026c428c2e415c5742c1 (patch)
tree7c26aa4148ed77a776ec728f919d0d0b064fbd5a
parent7b276fc17594b89040f1eda054858860c1dc1522 (diff)
downloadbusybox-327d2885ecab7fb8e876026c428c2e415c5742c1.zip
busybox-327d2885ecab7fb8e876026c428c2e415c5742c1.tar.gz
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.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index 93cebe2..8c78f5e 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -124,6 +124,16 @@ static const char signals[][7] = {
#ifdef SIGSYS
[SIGSYS ] = "SYS",
#endif
+#if ENABLE_FEATURE_RTMINMAX
+# ifdef __SIGRTMIN
+ [__SIGRTMIN] = "RTMIN",
+# endif
+// This makes array about x2 bigger.
+// More compact approach is to special-case SIGRTMAX in print_signames()
+//# ifdef __SIGRTMAX
+// [__SIGRTMAX] = "RTMAX",
+//# endif
+#endif
};
// Convert signal name to number.
@@ -216,6 +226,11 @@ void FAST_FUNC print_signames(void)
for (signo = 1; signo < ARRAY_SIZE(signals); signo++) {
const char *name = signals[signo];
if (name[0])
- puts(name);
+ printf("%2u) %s\n", signo, name);
}
+#if ENABLE_FEATURE_RTMINMAX
+# ifdef __SIGRTMAX
+ printf("%2u) %s\n", __SIGRTMAX, "RTMAX");
+# endif
+#endif
}