unix.c (fd_close): Do not close STDIN.
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 27 Mar 2008 05:30:18 +0000 (05:30 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 27 Mar 2008 05:30:18 +0000 (05:30 +0000)
2008-03-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

* io/unix.c (fd_close):  Do not close STDIN.

From-SVN: r133630

libgfortran/ChangeLog
libgfortran/io/unix.c

index 6ac6dfe89d0f75ff4589700ba9eadbf712137d31..892a2456ac7892f7164a8180a1cd6c77bc78c5ff 100644 (file)
@@ -1,3 +1,7 @@
+2008-03-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * io/unix.c (fd_close):  Do not close STDIN.
+
 2007-03-23  Thomas Koenig  <tkoenig@gcc.gnu.org
 
        PR libfortran/32972
index b3645f0003de30fcfc01369103b11b743b055f54..b6afe8ddfcc0eaaf50221a080115caa5cf645ffd 100644 (file)
@@ -871,7 +871,7 @@ fd_close (unix_stream * s)
   if (s->buffer != NULL && s->buffer != s->small_buffer)
     free_mem (s->buffer);
 
-  if (s->fd != STDOUT_FILENO && s->fd != STDERR_FILENO)
+  if (s->fd != STDOUT_FILENO && s->fd != STDERR_FILENO && s->fd != STDIN_FILENO)
     {
       if (close (s->fd) < 0)
         return FAILURE;