summaryrefslogtreecommitdiff
path: root/lib/sig2str.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-12-31 12:36:15 -0700
committerEric Blake <eblake@redhat.com>2011-01-06 14:21:48 -0700
commit92d72e3b846a8ba258831a30510742d3b7b53609 (patch)
tree25f6368cdd410d3aa03be02e4e4d3fff9a507fa9 /lib/sig2str.c
parent807533b8c9cec5320db9cf7e0746d229bd0700a6 (diff)
downloadgnulib-92d72e3b846a8ba258831a30510742d3b7b53609.tar.gz
signal: work around Haiku issue with SIGBUS
* lib/siglist.h: Add comment. * lib/sig2str.c (numname_table): Swap SIGBUS order, to match strsignal's favoring of SIGSEGV. * tests/test-signal.c (main): Avoid test failure. * doc/posix-headers/signal.texi (signal.h): Document the issue. Reported by Scott McCreary. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'lib/sig2str.c')
-rw-r--r--lib/sig2str.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 770f88c00f..70faa66c35 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -41,7 +41,7 @@
static struct numname { int num; char const name[8]; } numname_table[] =
{
/* Signals required by POSIX 1003.1-2001 base, listed in
- traditional numeric order. */
+ traditional numeric order where possible. */
#ifdef SIGHUP
NUMNAME (HUP),
#endif
@@ -66,12 +66,14 @@ static struct numname { int num; char const name[8]; } numname_table[] =
#ifdef SIGKILL
NUMNAME (KILL),
#endif
-#ifdef SIGBUS
- NUMNAME (BUS),
-#endif
#ifdef SIGSEGV
NUMNAME (SEGV),
#endif
+ /* On Haiku, SIGSEGV == SIGBUS, but we prefer SIGSEGV to match
+ strsignal.c output, so SIGBUS must be listed second. */
+#ifdef SIGBUS
+ NUMNAME (BUS),
+#endif
#ifdef SIGPIPE
NUMNAME (PIPE),
#endif