diff options
author | Christopher Faylor <me@cgf.cx> | 2002-02-27 23:01:10 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-02-27 23:01:10 +0000 |
commit | 27d01a721763529eca79f7a1b336a874b2350fe9 (patch) | |
tree | c33e8d1f324b0a30bf637d97eca4fd65039be0fb /winsup/testsuite/winsup.api/systemcall.c | |
parent | 9737b9b4de4388d90bdc3e202e8145033fa60b85 (diff) | |
download | cygnal-27d01a721763529eca79f7a1b336a874b2350fe9.tar.gz cygnal-27d01a721763529eca79f7a1b336a874b2350fe9.tar.bz2 cygnal-27d01a721763529eca79f7a1b336a874b2350fe9.zip |
* winsup.api/systemcall.c (main): Ensure that stdin is redirected.
Diffstat (limited to 'winsup/testsuite/winsup.api/systemcall.c')
-rw-r--r-- | winsup/testsuite/winsup.api/systemcall.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/testsuite/winsup.api/systemcall.c b/winsup/testsuite/winsup.api/systemcall.c index c9a34832f..026f430ff 100644 --- a/winsup/testsuite/winsup.api/systemcall.c +++ b/winsup/testsuite/winsup.api/systemcall.c @@ -10,6 +10,13 @@ main (int argc, char **argv) int fds[2]; static char buf[4096]; + 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 ()); + exit (1); + } + close (1); if ((fd = open ("/dev/null", O_WRONLY)) != 1) { |