re PR libfortran/39664 (Revision 145571 breaks stdio)

2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR libgfortran/39664
	* io/unix.c (raw_close): Don't close STDOUT_FILENO,
	STDERR_FILENO nor STDIN_FILENO.

From-SVN: r145636
This commit is contained in:
H.J. Lu 2009-04-06 16:07:51 -07:00
parent fe0a25ec79
commit 4197c13d08
2 changed files with 29 additions and 18 deletions

View File

@ -1,3 +1,9 @@
2009-04-06 H.J. Lu <hongjiu.lu@intel.com>
PR libgfortran/39664
* io/unix.c (raw_close): Don't close STDOUT_FILENO,
STDERR_FILENO nor STDIN_FILENO.
2009-04-06 David Edelsohn <edelsohn@gnu.org>
* io/io.h (struct stream): Rename truncate to trunc.

View File

@ -344,7 +344,12 @@ raw_close (unix_stream * s)
{
int retval;
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;
}