From 27d01a721763529eca79f7a1b336a874b2350fe9 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 27 Feb 2002 23:01:10 +0000 Subject: * winsup.api/systemcall.c (main): Ensure that stdin is redirected. --- winsup/testsuite/ChangeLog | 4 ++++ winsup/testsuite/winsup.api/systemcall.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog index dcc9f0a04..c5fcd9447 100644 --- a/winsup/testsuite/ChangeLog +++ b/winsup/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-02-27 Christopher Faylor + + * winsup.api/systemcall.c (main): Ensure that stdin is redirected. + 2001-11-18 Egor Duda * winsup.api/pthread/condvar3_1.c: Fix debugging output. 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) { -- cgit v1.2.3