summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-27 05:30:18 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-27 05:30:18 +0000
commit582dd19143c4ef39edd44f24920bf5afba916471 (patch)
tree380072f9acea76ec61579802242d07b3472b9acb
parent1741c50c05580eac35d020fe5e0ee4f74a169586 (diff)
downloadppe42-gcc-582dd19143c4ef39edd44f24920bf5afba916471.tar.gz
ppe42-gcc-582dd19143c4ef39edd44f24920bf5afba916471.zip
2008-03-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* io/unix.c (fd_close): Do not close STDIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133630 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgfortran/ChangeLog4
-rw-r--r--libgfortran/io/unix.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 6ac6dfe89d0..892a2456ac7 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index b3645f0003d..b6afe8ddfcc 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -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;
OpenPOWER on IntegriCloud