Mercurial > hg > octave-nkf > gnulib-hg
changeset 10529:e39ca1ce24a6
Avoid test failure on glibc with LinuxThreads.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 28 Sep 2008 16:04:07 +0200 |
parents | 97cab1215a7c |
children | 6a291a817839 |
files | ChangeLog tests/test-sigaction.c |
diffstat | 2 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-28 Bruno Haible <bruno@clisp.org> + + * tests/test-sigaction.c (handler, main): Disable the check whether + SA_RESETHAND has reverted the installed handler to SIG_DFL. Needed on + glibc systems with LinuxThreads. + 2008-09-28 Bruno Haible <bruno@clisp.org> * doc/posix-functions/freopen.texi: Mention the trailing slash problem.
--- a/tests/test-sigaction.c +++ b/tests/test-sigaction.c @@ -76,7 +76,12 @@ ASSERT (sa.sa_handler == handler); break; case 1: + /* This assertion fails on glibc-2.3.6 systems with LinuxThreads, + when this program is linked with -lpthread, due to the sigaction() + override in libpthread.so. */ +#if !defined __GLIBC__ ASSERT (sa.sa_handler == SIG_DFL); +#endif break; default: ASSERT (0); @@ -89,24 +94,31 @@ struct sigaction sa; struct sigaction old_sa; sa.sa_handler = handler; + sa.sa_flags = 0; ASSERT (sigemptyset (&sa.sa_mask) == 0); ASSERT (sigaction (SIGABRT, &sa, NULL) == 0); ASSERT (raise (SIGABRT) == 0); + sa.sa_flags = SA_RESETHAND | SA_NODEFER; ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0); ASSERT ((old_sa.sa_flags & MASK_SA_FLAGS) == 0); ASSERT (old_sa.sa_handler == handler); ASSERT (raise (SIGABRT) == 0); + sa.sa_handler = SIG_DFL; ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0); ASSERT ((old_sa.sa_flags & SA_SIGINFO) == 0); +#if !defined __GLIBC__ /* see above */ ASSERT (old_sa.sa_handler == SIG_DFL); +#endif + sa.sa_handler = SIG_IGN; ASSERT (sigaction (SIGABRT, &sa, NULL) == 0); ASSERT (raise (SIGABRT) == 0); ASSERT (sigaction (SIGABRT, NULL, &old_sa) == 0); ASSERT (old_sa.sa_handler == SIG_IGN); ASSERT (raise (SIGABRT) == 0); + return 0; }