From 5a2682ae68141b7b557e1c2690c5905cf7c84602 Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni Date: Thu, 25 Jan 2018 13:23:56 +0100 Subject: make non-standard signals optional Closes: #1 [via git-merge-pr] --- extrace.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/extrace.c b/extrace.c index 16a227b..85df965 100644 --- a/extrace.c +++ b/extrace.c @@ -145,37 +145,49 @@ sig2name(int sig) { switch (sig) { #define X(s) case s: return #s; + /* signals defined in POSIX.1-1990 */ X(SIGHUP) X(SIGINT) X(SIGQUIT) X(SIGILL) - X(SIGTRAP) X(SIGABRT) - X(SIGBUS) X(SIGFPE) X(SIGKILL) - X(SIGUSR1) X(SIGSEGV) + X(SIGUSR1) X(SIGUSR2) X(SIGPIPE) X(SIGALRM) X(SIGTERM) - X(SIGSTKFLT) X(SIGCHLD) X(SIGCONT) X(SIGSTOP) X(SIGTSTP) X(SIGTTIN) X(SIGTTOU) + + /* signals defined in POSIX.1-2001 */ + X(SIGBUS) + X(SIGPOLL) + X(SIGPROF) + X(SIGSYS) + X(SIGTRAP) X(SIGURG) + X(SIGVTALRM) X(SIGXCPU) X(SIGXFSZ) - X(SIGVTALRM) - X(SIGPROF) - X(SIGWINCH) - X(SIGPOLL) - X(SIGPWR) - X(SIGSYS) + + /* other signals */ +#ifdef SIGSTKFLT + X(SIGSTKFLT) /* Stack fault on coprocessor (unused) */ +#endif +#ifdef SIGWINCH + X(SIGWINCH) /* Window resize signal (4.3BSD) */ +#endif +#ifdef SIGPWR + X(SIGPWR) /* Power failure (System V) */ +#endif + #undef X default: { static char buf[8]; -- cgit 1.4.1