]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* misc/tst-pselect.c (do_test): Fix sigblock argument.
authorJakub Jelinek <jakub@redhat.com>
Fri, 12 Jan 2007 17:49:04 +0000 (17:49 +0000)
committerJakub Jelinek <jakub@redhat.com>
Fri, 12 Jan 2007 17:49:04 +0000 (17:49 +0000)
* misc/tst-pselect.c (do_test): Make sure the helper process is
terminating when the test is aborted.

ChangeLog
misc/tst-pselect.c

index 9036c1d1786c4ed47d14252cd01a85035403bf98..fe2f7bf7b59db08bc912e44994a9cf9cd4de27ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-12-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * misc/tst-pselect.c (do_test): Fix sigblock argument.
+
+2006-12-14  Ulrich Drepper  <drepper@redhat.com>
+
+       * misc/tst-pselect.c (do_test): Make sure the helper process is
+       terminating when the test is aborted.
+
 2006-12-13  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #2337]
index 123c31912e6edf8940c4508a26684fe6cfd03fb2..35d51d8ee04ac49e94e4b1decc41f0d08e586bd2 100644 (file)
@@ -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;
 }