diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-01-12 17:49:04 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-01-12 17:49:04 +0000 |
commit | b1d424b6b00bf95f65e77a720af2d89f52201759 (patch) | |
tree | 5a9c8de6e2d01e5d498daccfaf20e2f43c6b26e4 /misc | |
parent | 6d122c1de8aac283440d1067990beeae7e2679e9 (diff) | |
download | glibc-b1d424b6b00bf95f65e77a720af2d89f52201759.tar glibc-b1d424b6b00bf95f65e77a720af2d89f52201759.tar.gz glibc-b1d424b6b00bf95f65e77a720af2d89f52201759.tar.bz2 glibc-b1d424b6b00bf95f65e77a720af2d89f52201759.zip |
* misc/tst-pselect.c (do_test): Fix sigblock argument.
* misc/tst-pselect.c (do_test): Make sure the helper process is
terminating when the test is aborted.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/tst-pselect.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/misc/tst-pselect.c b/misc/tst-pselect.c index 123c31912e..35d51d8ee0 100644 --- a/misc/tst-pselect.c +++ b/misc/tst-pselect.c @@ -29,7 +29,16 @@ do_test (void) return 1; } - if (sigblock (SIGUSR1) != 0) + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_NOCLDWAIT; + + if (sigaction (SIGCHLD, &sa, NULL) != 0) + { + puts ("2nd sigaction failed"); + return 1; + } + + if (sigblock (sigmask (SIGUSR1)) != 0) { puts ("sigblock failed"); return 1; @@ -52,6 +61,7 @@ do_test (void) struct timespec to = { .tv_sec = 0, .tv_nsec = 500000000 }; + pid_t parent = getpid (); pid_t p = fork (); if (p == 0) { @@ -63,6 +73,9 @@ do_test (void) int e; do { + if (getppid () != parent) + exit (2); + errno = 0; e = pselect (fds[0][0] + 1, &rfds, NULL, NULL, &to, &ss); } @@ -108,12 +121,6 @@ do_test (void) return 1; } - if (TEMP_FAILURE_RETRY (waitpid (p, NULL, 0)) != p) - { - puts ("waitpid failed"); - return 1; - } - return 0; } |