diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-02-17 10:47:41 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-02-17 10:47:41 +0000 |
commit | 371a2972795a2eec8bd09fb8173b1ed800d68896 (patch) | |
tree | dc6996c3471d6b02a212d50bbf91f29cddc047d5 | |
parent | 5430d926c54d552794e2ef626b37b7f8bc1ec68e (diff) | |
download | glibc-371a2972795a2eec8bd09fb8173b1ed800d68896.tar glibc-371a2972795a2eec8bd09fb8173b1ed800d68896.tar.gz glibc-371a2972795a2eec8bd09fb8173b1ed800d68896.tar.bz2 glibc-371a2972795a2eec8bd09fb8173b1ed800d68896.zip |
Update.
* tst-cancel1.c (tf): Block all signals.
-rw-r--r-- | nptl/ChangeLog | 2 | ||||
-rw-r--r-- | nptl/tst-cancel1.c | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 2acb2fb819..96f6f6a3d9 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,7 @@ 2003-02-17 Ulrich Drepper <drepper@redhat.com> + * tst-cancel1.c (tf): Block all signals. + * Makefile (tests): Add tst-basic6. * tst-basic6.c: New file. diff --git a/nptl/tst-cancel1.c b/nptl/tst-cancel1.c index 99a8339f0c..654c8a7a56 100644 --- a/nptl/tst-cancel1.c +++ b/nptl/tst-cancel1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -18,6 +18,7 @@ 02111-1307 USA. */ #include <pthread.h> +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -42,11 +43,21 @@ cleanup (void *arg) static void * tf (void *arg) { - int err; + /* Ignore all signals. This must not have any effect on delivering + the cancellation signal. */ + sigset_t ss; + + sigfillset (&ss); + + if (pthread_sigmask (SIG_BLOCK, &ss, NULL) != 0) + { + puts ("pthread_sigmask failed"); + exit (1); + } pthread_cleanup_push (cleanup, (void *) 42l); - err = pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + int err = pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); if (err != 0) { printf ("setcanceltype failed: %s\n", strerror (err)); |