This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/39664] [4.5 Regression] Revision 145571 breaks stdio
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Apr 2009 22:43:50 -0000
- Subject: [Bug libfortran/39664] [4.5 Regression] Revision 145571 breaks stdio
- References: <bug-39664-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from hjl dot tools at gmail dot com 2009-04-06 22:43 -------
This patch seems to work for the small testcase:
Index: io/unix.c
===================================================================
--- io/unix.c (revision 145571)
+++ io/unix.c (working copy)
@@ -344,7 +344,12 @@ raw_close (unix_stream * s)
{
int retval;
- retval = close (s->fd);
+ if (s->fd != STDOUT_FILENO
+ && s->fd != STDERR_FILENO
+ && s->fd != STDIN_FILENO)
+ retval = close (s->fd);
+ else
+ retval = SUCCESS;
free_mem (s);
return retval;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39664