Cygwin: testsuite: Also check direct call in systemcall

Check direct call to system(), as well as one in a subprocess.

(This is a lot easier to debug when it's completely broken by the
environment the test is running in)

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon Turney 2023-07-09 12:12:23 +01:00
parent 7c0750e962
commit 79a9288434
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
1 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,14 @@ main (int argc, char **argv)
fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror (errno));
exit (1);
}
n = system ("ls");
if (n != 0)
{
fprintf (stderr, "system() (in parent) call returned %x\n", n);
exit (1);
}
if (pipe (fds))
{
fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
@ -61,7 +69,7 @@ main (int argc, char **argv)
}
if (n != 0)
{
fprintf (stderr, "system() call returned %x\n", n);
fprintf (stderr, "system() (in child) call returned %x\n", n);
exit (1);
}
exit (0);