Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/testsuite/winsup.api/systemcall.c')
-rw-r--r--winsup/testsuite/winsup.api/systemcall.c7
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)
{