summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Braud-Santoni <nicolas@braud-santoni.eu>2018-01-25 13:23:56 +0100
committerLeah Neukirchen <leah@vuxu.org>2018-01-25 13:46:17 +0100
commit5a2682ae68141b7b557e1c2690c5905cf7c84602 (patch)
treea94a7c32d188317e3ed250f9d7fbff15ebbe6c7d
parentd984ff798f88c71abb703e4ac92ee8477b1e8eb3 (diff)
downloadextrace-5a2682ae68141b7b557e1c2690c5905cf7c84602.tar.gz
extrace-5a2682ae68141b7b557e1c2690c5905cf7c84602.tar.xz
extrace-5a2682ae68141b7b557e1c2690c5905cf7c84602.zip
make non-standard signals optional
Closes: #1 [via git-merge-pr]
-rw-r--r--extrace.c32
1 files 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];