This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-721-gd7a05d0


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  d7a05d0728924b25c5ece7fa41f79fe4b073d92c (commit)
      from  46f1d8a6b54fc7ed7a7047d5d2ed1a0b884de6c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d7a05d0728924b25c5ece7fa41f79fe4b073d92c

commit d7a05d0728924b25c5ece7fa41f79fe4b073d92c
Author: Maciej W. Rozycki <macro@codesourcery.com>
Date:   Mon Jun 30 20:05:34 2014 +0100

    test-skeleton: Kill any child process's offspring
    
    This makes sure any subprocesses created by the program being tested get
    killed as well if their parent times out.  Otherwise if they are really
    stuck, they may remain there running forever after the test case and
    then the whole test suite has completed, until killed by hand.
    
    	* test-skeleton.c (signal_handler): Kill the whole process group
    	before killing the child individually.
    	(main): Report any failure on `setpgid'.

diff --git a/ChangeLog b/ChangeLog
index 785baf9..b2ea30c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-30  Maciej W. Rozycki  <macro@codesourcery.com>
+	    Roland McGrath <roland@hack.frob.com>
+
+	* test-skeleton.c (signal_handler): Kill the whole process group
+	before killing the child individually.
+	(main): Report any failure on `setpgid'.
+
 2014-06-30  Roland McGrath  <roland@hack.frob.com>
 
 	* sysdeps/arm/nptl/tls.h: Rename the multiple inclusion guard
diff --git a/test-skeleton.c b/test-skeleton.c
index 286d141..c1278ca 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -17,6 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
@@ -138,7 +139,10 @@ signal_handler (int sig __attribute__ ((unused)))
   int killed;
   int status;
 
-  /* Send signal.  */
+  assert (pid > 1);
+  /* Kill the whole process group.  */
+  kill (-pid, SIGKILL);
+  /* In case setpgid failed in the child, kill it individually too.  */
   kill (pid, SIGKILL);
 
   /* Wait for it to terminate.  */
@@ -342,7 +346,8 @@ main (int argc, char *argv[])
 
       /* We put the test process in its own pgrp so that if it bogusly
 	 generates any job control signals, they won't hit the whole build.  */
-      setpgid (0, 0);
+      if (setpgid (0, 0) != 0)
+	printf ("Failed to set the process group ID: %m\n");
 
       /* Execute the test function and exit with the return value.   */
       exit (TEST_FUNCTION);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |    7 +++++++
 test-skeleton.c |    9 +++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]