OSDN Git Service

* winsup.api/systemcall.c (main): Ensure that stdin is redirected.
authorcgf <cgf>
Wed, 27 Feb 2002 23:01:08 +0000 (23:01 +0000)
committercgf <cgf>
Wed, 27 Feb 2002 23:01:08 +0000 (23:01 +0000)
winsup/testsuite/ChangeLog
winsup/testsuite/winsup.api/systemcall.c

index dcc9f0a..c5fcd94 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 c9a3483..026f430 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)
     {