[PATCH] fix posix/tst-spawn test

Szabolcs Nagy szabolcs.nagy@arm.com
Wed Sep 27 14:41:00 GMT 2017


On 27/09/17 14:00, Florian Weimer wrote:
> 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.

i didn't want to fix the entire test to use the new
conventions, so i only changed these lines.


The test spawns two children but only waited for one.
The fix avoids printing to stderr.

2017-09-27  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* posix/tst-spawn.c (do_test): Wait for both children.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: spwn.diff
Type: text/x-patch
Size: 1604 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170927/957259c6/attachment.bin>


More information about the Libc-alpha mailing list