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.26-559-g5ba41de


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  5ba41de9ed2cf6cf39a9cd7a7541bc71fc447d52 (commit)
      from  7bacdcfc42b01a4c565abfc3d789577850481d05 (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=5ba41de9ed2cf6cf39a9cd7a7541bc71fc447d52

commit 5ba41de9ed2cf6cf39a9cd7a7541bc71fc447d52
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Sep 26 17:40:09 2017 +0100

    fix posix/tst-spawn test
    
    The test spawns two children but only waited for one.
    The fix avoids printing to stderr.
    
    	* posix/tst-spawn.c (do_test): Wait for both children.

diff --git a/ChangeLog b/ChangeLog
index 7d1fbc6..58b2815 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-12  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	* posix/tst-spawn.c (do_test): Wait for both children.
+
 2017-10-12  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #22284]
diff --git a/posix/tst-spawn.c b/posix/tst-spawn.c
index 08d92bd..4e5e763 100644
--- a/posix/tst-spawn.c
+++ b/posix/tst-spawn.c
@@ -23,9 +23,10 @@
 #include <spawn.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <wait.h>
 #include <sys/param.h>
+#include <support/check.h>
+#include <support/xunistd.h>
 
 
 /* Nonzero if the program gets called via `exec'.  */
@@ -249,13 +250,16 @@ do_test (int argc, char *argv[])
      error (EXIT_FAILURE, errno, "posix_spawn_file_actions_destroy");
    free (name3_copy);
 
-  /* Wait for the child.  */
-  if (waitpid (pid, &status, 0) != pid)
-    error (EXIT_FAILURE, errno, "wrong child");
+  /* Wait for the children.  */
+  TEST_VERIFY (xwaitpid (pid, &status, 0) == pid);
+  TEST_VERIFY (WIFEXITED (status));
+  TEST_VERIFY (!WIFSIGNALED (status));
+  TEST_VERIFY (WEXITSTATUS (status) == 0);
 
-  if (WTERMSIG (status) != 0)
-    error (EXIT_FAILURE, 0, "Child terminated incorrectly");
-  status = WEXITSTATUS (status);
+  xwaitpid (-1, &status, 0);
+  TEST_VERIFY (WIFEXITED (status));
+  TEST_VERIFY (!WIFSIGNALED (status));
+  TEST_VERIFY (WEXITSTATUS (status) == 0);
 
-  return status;
+  return 0;
 }

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

Summary of changes:
 ChangeLog         |    4 ++++
 posix/tst-spawn.c |   20 ++++++++++++--------
 2 files changed, 16 insertions(+), 8 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]