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:
parent
7c0750e962
commit
79a9288434
|
@ -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));
|
fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n = system ("ls");
|
||||||
|
if (n != 0)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "system() (in parent) call returned %x\n", n);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
if (pipe (fds))
|
if (pipe (fds))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
|
fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
|
||||||
|
@ -61,7 +69,7 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
if (n != 0)
|
if (n != 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "system() call returned %x\n", n);
|
fprintf (stderr, "system() (in child) call returned %x\n", n);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
exit (0);
|
exit (0);
|
||||||
|
|
Loading…
Reference in New Issue