This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.

Jerry

2008-03-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>

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


Index: unix.c =================================================================== --- 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) 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]