This is the mail archive of the
mailing list for the GCC project.
[patch, libfortran] Consistant behavior for pre-connected units
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 26 Mar 2008 22:07:27 -0700
- Subject: [patch, libfortran] Consistant behavior for pre-connected units
Sa Liu has been having some problems with pre-connected units on Cell
architecture. This patch will give consistent behavior. It is trivial and
avoids closing STDIN similar to STDOUT and STDERR.
I will commit under simple and obvious rule. Regression tested on x86-64-inux-gnu.
2008-03-26 Jerry DeLisle <email@example.com>
* io/unix.c (fd_close): Do not close STDIN.
--- unix.c (revision 133453)
+++ unix.c (working copy)
@@ -871,7 +871,7 @@ fd_close (unix_stream * s)
if (s->buffer != NULL && s->buffer != s->small_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)