Mercurial > hg > octave-kai > gnulib-hg
changeset 14138:222670d93ba4
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>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Fri, 31 Dec 2010 12:36:15 -0700 |
parents | 2dbfa19b11d0 |
children | 70efe04c9de0 |
files | ChangeLog doc/posix-headers/signal.texi lib/sig2str.c lib/siglist.h tests/test-signal.c |
diffstat | 5 files changed, 23 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -350,6 +350,14 @@ 2010-12-31 Eric Blake <eblake@redhat.com> + 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. + nl_langinfo: fix YESEXPR on Irix 6.5 * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Test for Irix bug. * lib/nl_langinfo.c (rpl_nl_langinfo): Work around it.
--- a/doc/posix-headers/signal.texi +++ b/doc/posix-headers/signal.texi @@ -39,4 +39,8 @@ The macros @code{SIGRTMIN} and @code{SIGRTMAX} expand to an expression of type @code{long} instead of @code{int} on some platforms: OSF/1 5.1. +@item +The macro @code{SIGBUS} is set to the same value as @code{SIGSEGV}, +rather than being a distinct signal, on some platforms: +Haiku. @end itemize
--- 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 @@ #ifdef SIGKILL NUMNAME (KILL), #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 SIGSEGV - NUMNAME (SEGV), -#endif #ifdef SIGPIPE NUMNAME (PIPE), #endif