about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-12-14 18:03:28 +0000
committerUlrich Drepper <drepper@redhat.com>2006-12-14 18:03:28 +0000
commit36775704ae63c5566a4169e88d9a806e8a37ab40 (patch)
treecd7bb329c508e9e51fc3393f19b58eb2a537c409
parent1cc444baba3d085154c7a75a058cefc86c2ffce7 (diff)
downloadglibc-36775704ae63c5566a4169e88d9a806e8a37ab40.tar.gz
glibc-36775704ae63c5566a4169e88d9a806e8a37ab40.tar.xz
glibc-36775704ae63c5566a4169e88d9a806e8a37ab40.zip
* misc/tst-pselect.c (do_test): Make sure the helper process is
	terminating when the test is aborted.
-rw-r--r--ChangeLog5
-rw-r--r--misc/tst-pselect.c19
2 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 53b8f3d8ba..cdcdf5a42c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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>
 
 	* sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME.
diff --git a/misc/tst-pselect.c b/misc/tst-pselect.c
index 123c31912e..54c5ee8261 100644
--- a/misc/tst-pselect.c
+++ b/misc/tst-pselect.c
@@ -29,6 +29,15 @@ do_test (void)
       return 1;
     }
 
+  sa.sa_handler = SIG_IGN;
+  sa.sa_flags = SA_NOCLDWAIT;
+
+  if (sigaction (SIGCHLD, &sa, NULL) != 0)
+    {
+      puts ("2nd sigaction failed");
+      return 1;
+    }
+
   if (sigblock (SIGUSR1) != 0)
     {
       puts ("sigblock failed");
@@ -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;
 }