mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
NPTL: Conditionalize some sanity tests for SIGCANCEL/SIGSETXID.
This commit is contained in:
parent
1ac074e66e
commit
022f481264
@ -1,5 +1,10 @@
|
|||||||
2015-02-06 Roland McGrath <roland@hack.frob.com>
|
2015-02-06 Roland McGrath <roland@hack.frob.com>
|
||||||
|
|
||||||
|
* nptl/tst-cancel25.c (tf2): Test for SIGCANCEL being blocked only if
|
||||||
|
it's defined.
|
||||||
|
* nptl/tst-signal7.c (do_test): Test SIGCANCEL only if it's defined.
|
||||||
|
Test SIGSETXID only if it's defined.
|
||||||
|
|
||||||
* nptl/tst-locale1.c (useless): Use SIGRTMIN only if it's defined.
|
* nptl/tst-locale1.c (useless): Use SIGRTMIN only if it's defined.
|
||||||
|
|
||||||
* rt/tst-timer2.c (do_test): Don't initialize SIGEV.sigev_signo, which
|
* rt/tst-timer2.c (do_test): Don't initialize SIGEV.sigev_signo, which
|
||||||
|
@ -11,6 +11,7 @@ static pthread_t th2;
|
|||||||
static void *
|
static void *
|
||||||
tf2 (void *arg)
|
tf2 (void *arg)
|
||||||
{
|
{
|
||||||
|
#ifdef SIGCANCEL
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
if (pthread_sigmask (SIG_SETMASK, NULL, &mask) != 0)
|
if (pthread_sigmask (SIG_SETMASK, NULL, &mask) != 0)
|
||||||
{
|
{
|
||||||
@ -22,6 +23,7 @@ tf2 (void *arg)
|
|||||||
puts ("SIGCANCEL blocked in new thread");
|
puts ("SIGCANCEL blocked in new thread");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Sync with the main thread so that we do not test anything else. */
|
/* Sync with the main thread so that we do not test anything else. */
|
||||||
int e = pthread_barrier_wait (&b);
|
int e = pthread_barrier_wait (&b);
|
||||||
|
@ -27,6 +27,7 @@ do_test (void)
|
|||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
#ifdef SIGCANCEL
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (sigaction (SIGCANCEL, NULL, NULL) == 0)
|
if (sigaction (SIGCANCEL, NULL, NULL) == 0)
|
||||||
{
|
{
|
||||||
@ -38,7 +39,9 @@ do_test (void)
|
|||||||
puts ("sigaction(SIGCANCEL) did not set errno to EINVAL");
|
puts ("sigaction(SIGCANCEL) did not set errno to EINVAL");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SIGSETXID
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (sigaction (SIGSETXID, NULL, NULL) == 0)
|
if (sigaction (SIGSETXID, NULL, NULL) == 0)
|
||||||
{
|
{
|
||||||
@ -50,6 +53,7 @@ do_test (void)
|
|||||||
puts ("sigaction(SIGSETXID) did not set errno to EINVAL");
|
puts ("sigaction(SIGSETXID) did not set errno to EINVAL");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user