This is the mail archive of the libc-alpha@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]

Re: [PATCH] fix posix/tst-spawn test


On 09/27/2017 02:56 PM, Szabolcs Nagy wrote:
+  /* Wait for the child.  */
+  if (waitpid (pid, &status, 0) != pid)
+    error (EXIT_FAILURE, errno, "wrong child");

You could use

  TEST_VERIFY (xwaitpid (pid, &status, 0) != pid));

instead.

In fact, all the error calls are invalid in tests because they write to standard error.

So perhaps use

  TEST_VERIFY (WIFEXITED (status));
  TEST_VERIFY (!WIFSIGNALED (status));
  TEST_VERIFY (WEXITSTATUS (status) == 0);

The error messages did not contain the status bits anyway, so this is not a regression as far as diagnostics are concerned.

The existing WTERMSIG check is invalid because !WIFSIGNALED (status).

Thanks,
Florian


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