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:
authorChristopher Faylor <me@cgf.cx>2002-02-28 02:01:10 +0300
committerChristopher Faylor <me@cgf.cx>2002-02-28 02:01:10 +0300
commit27d01a721763529eca79f7a1b336a874b2350fe9 (patch)
treec33e8d1f324b0a30bf637d97eca4fd65039be0fb
parent9737b9b4de4388d90bdc3e202e8145033fa60b85 (diff)
* winsup.api/systemcall.c (main): Ensure that stdin is redirected.
-rw-r--r--winsup/testsuite/ChangeLog4
-rw-r--r--winsup/testsuite/winsup.api/systemcall.c7
2 files changed, 11 insertions, 0 deletions
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 <cgf@redhat.com>
+
+ * winsup.api/systemcall.c (main): Ensure that stdin is redirected.
+
2001-11-18 Egor Duda <deo@logos-m.ru>
* 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)
{