This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] fix posix/tst-spawn test
- From: Florian Weimer <fweimer at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd at arm dot com
- Date: Wed, 27 Sep 2017 15:00:56 +0200
- Subject: Re: [PATCH] fix posix/tst-spawn test
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9EC812C9764
- References: <59CB9FFA.20307@arm.com>
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