aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--posix/tst-spawn.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3865128..25a644f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-02-01 Stefan Liebler <stli@linux.ibm.com>
+
+ * posix/tst-spawn do_test(): Move waitpid before posix_spawn.
+
2019-01-31 Vineet Gupta <vgupta@synopsys.com>
* sysdeps/unix/make-syscalls.sh: Fix comment referencing
diff --git a/posix/tst-spawn.c b/posix/tst-spawn.c
index eea5add..9aa7e62 100644
--- a/posix/tst-spawn.c
+++ b/posix/tst-spawn.c
@@ -237,6 +237,12 @@ do_test (int argc, char *argv[])
TEST_COMPARE (posix_spawn (&pid, argv[1], &actions, NULL, spargv, environ),
0);
+ /* Wait for the children. */
+ TEST_COMPARE (xwaitpid (pid, &status, 0), pid);
+ TEST_VERIFY (WIFEXITED (status));
+ TEST_VERIFY (!WIFSIGNALED (status));
+ TEST_COMPARE (WEXITSTATUS (status), 0);
+
/* Same test but with a NULL pid argument. */
TEST_COMPARE (posix_spawn (NULL, argv[1], &actions, NULL, spargv, environ),
0);
@@ -246,11 +252,6 @@ do_test (int argc, char *argv[])
free (name3_copy);
/* Wait for the children. */
- TEST_COMPARE (xwaitpid (pid, &status, 0), pid);
- TEST_VERIFY (WIFEXITED (status));
- TEST_VERIFY (!WIFSIGNALED (status));
- TEST_COMPARE (WEXITSTATUS (status), 0);
-
xwaitpid (-1, &status, 0);
TEST_VERIFY (WIFEXITED (status));
TEST_VERIFY (!WIFSIGNALED (status));