]> sourceware.org Git - newlib-cygwin.git/commitdiff
* winsup.api/systemcall.c (main): Ensure that stdin is redirected.
authorChristopher Faylor <me@cgf.cx>
Wed, 27 Feb 2002 23:01:10 +0000 (23:01 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 27 Feb 2002 23:01:10 +0000 (23:01 +0000)
winsup/testsuite/ChangeLog
winsup/testsuite/winsup.api/systemcall.c

index dcc9f0a04434a34dbc0978ec3d5e16405e3fc1a0..c5fcd9447f5153dafca2f08190c1e8251372899c 100644 (file)
@@ -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.
index c9a34832fea8557fd29de61479fb22bc92eea1c1..026f430ffb4b1a75d9acc88a176f75a6e2e9d961 100644 (file)
@@ -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)
     {
This page took 0.030024 seconds and 5 git commands to generate.