re PR libfortran/20179 (cannot mix C and Fortran I/O)

PR libfortran/20179
	* io/unix.c (fd_close): Add test so that we don't close()
	stdout and stderr.

From-SVN: r100353
This commit is contained in:
Francois-Xavier Coudert 2005-05-30 09:38:36 +02:00 committed by François-Xavier Coudert
parent 66859ace31
commit 12e59662e3
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-05-23 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20179
* io/unix.c (fd_close): Add test so that we don't close()
stdout and stderr.
2005-05-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20006

View File

@ -542,8 +542,11 @@ fd_close (unix_stream * s)
if (s->buffer != NULL && s->buffer != s->small_buffer)
free_mem (s->buffer);
if (close (s->fd) < 0)
return FAILURE;
if (s->fd != STDOUT_FILENO && s->fd != STDERR_FILENO)
{
if (close (s->fd) < 0)
return FAILURE;
}
free_mem (s);