summaryrefslogtreecommitdiffstats
path: root/winsup/testsuite/winsup.api/systemcall.c
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-01-23 21:21:28 +0000
committerChristopher Faylor <me@cgf.cx>2003-01-23 21:21:28 +0000
commit9b978ffe8b67bdccd1e0c5bf3ef3c65d60bc6cd3 (patch)
tree9c1a9a440a79bae5c23602dd05d16645ef4c9419 /winsup/testsuite/winsup.api/systemcall.c
parentd8f0f146b8befe92d951c5e5907d41e23f376679 (diff)
downloadcygnal-9b978ffe8b67bdccd1e0c5bf3ef3c65d60bc6cd3.tar.gz
cygnal-9b978ffe8b67bdccd1e0c5bf3ef3c65d60bc6cd3.tar.bz2
cygnal-9b978ffe8b67bdccd1e0c5bf3ef3c65d60bc6cd3.zip
* libltp/include/test.h: Fix C warnings.
* winsup.api/checksignal.c: Ditto. * winsup.api/crlf.c: Ditto. * winsup.api/devzero.c: Ditto. * winsup.api/iospeed.c: Ditto. * winsup.api/mmaptest01.c: Ditto. * winsup.api/mmaptest02.c: Ditto. * winsup.api/mmaptest03.c: Ditto. * winsup.api/mmaptest04.c: Ditto. * winsup.api/nullgetcwd.c: Ditto. * winsup.api/sigchld.c: Ditto. * winsup.api/signal-into-win32-api.c: Ditto. * winsup.api/systemcall.c: Ditto. * winsup.api/waitpid.c: Ditto. * winsup.api/pthread/mainthreadexits.c: Ditto. * winsup.api/pthread/test.h: Ditto. * winsup.api/pthread/threadidafterfork.c: Ditto. * Makefile.in: Remove cygrun.exe from RUNTIME since it is built here now.
Diffstat (limited to 'winsup/testsuite/winsup.api/systemcall.c')
-rw-r--r--winsup/testsuite/winsup.api/systemcall.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/winsup/testsuite/winsup.api/systemcall.c b/winsup/testsuite/winsup.api/systemcall.c
index 026f430ff..91dd748c0 100644
--- a/winsup/testsuite/winsup.api/systemcall.c
+++ b/winsup/testsuite/winsup.api/systemcall.c
@@ -2,6 +2,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/wait.h>
int
main (int argc, char **argv)
@@ -13,19 +16,19 @@ main (int argc, char **argv)
close (0);
if ((fd = open ("/dev/null", O_WRONLY)) != 0)
{
- fprintf (stderr, "couldn't redirect stdin to /dev/null, fd %d - %s\n", fd, strerror ());
+ fprintf (stderr, "couldn't redirect stdin to /dev/null, fd %d - %s\n", fd, strerror (errno));
exit (1);
}
close (1);
if ((fd = open ("/dev/null", O_WRONLY)) != 1)
{
- fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror ());
+ fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror (errno));
exit (1);
}
if (pipe (fds))
{
- fprintf (stderr, "pipe call failed - %s\n", strerror ());
+ fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
exit (1);
}
if ((pid = fork ()) == 0)
@@ -33,7 +36,7 @@ main (int argc, char **argv)
close (fds[0]);
if (dup2 (fds[1], 2) != 2)
{
- fprintf (stderr, "couldn't redirect stderr to pipe - %s\n", strerror ());
+ fprintf (stderr, "couldn't redirect stderr to pipe - %s\n", strerror (errno));
exit (1);
}
exit (system ("ls"));
@@ -58,7 +61,7 @@ main (int argc, char **argv)
}
if (n != 0)
{
- fprintf (stderr, "system() call returned %p\n", n);
+ fprintf (stderr, "system() call returned %p\n", (void *) n);
exit (1);
}
exit (0);