diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-06 23:07:51 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-06 23:07:51 +0000 |
commit | 8b89aa85391798c56058cdb65c877ae2dddb490d (patch) | |
tree | 92dbf267a9a5a57ff0a6436365b117a8cad0ad9c /libgfortran | |
parent | 30904b2c6b5160a92e1d9abed48ac6dd7a42e94a (diff) | |
download | gcc-8b89aa85391798c56058cdb65c877ae2dddb490d.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145636 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 40 | ||||
-rw-r--r-- | libgfortran/io/unix.c | 7 |
2 files changed, 29 insertions, 18 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index f2cf22265ff..b1a4e19f052 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -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. @@ -14,7 +20,7 @@ 2009-04-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> - PR libfortran/37754 + PR libfortran/37754 * io/io.h (format_hash_entry): New structure for hash table. (format_hash_table): The hash table itself. (free_format_data): Revise function prototype. @@ -47,7 +53,7 @@ 2009-04-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> - PR libfortran/37754 + PR libfortran/37754 * io/transfer.c (formatted_transfer_scalar): Remove this function by factoring it into two new functions, one for read and one for write, eliminating all the conditionals for read or write mode. @@ -57,7 +63,7 @@ 2009-04-05 Janne Blomqvist <jb@gcc.gnu.org> - PR libfortran/25561 libfortran/37754 + PR libfortran/25561 libfortran/37754 * io/io.h (struct stream): Define new stream interface function pointers, and inline functions for accessing it. (struct fbuf): Use int instead of size_t, remove flushed element. @@ -79,7 +85,7 @@ (fbuf_read): New prototype. (fbuf_getc_refill): New prototype. (fbuf_getc): New inline function. - * io/fbuf.c (fbuf_init): Use int, get rid of flushed. + * io/fbuf.c (fbuf_init): Use int, get rid of flushed. (fbuf_debug): New function. (fbuf_reset): Flush, and return position offset. (fbuf_alloc): Simplify, don't flush, just realloc. @@ -515,18 +521,18 @@ PR libfortran/34670 * intrinsics/reshape_generic.c: Add bounds checking. * m4/reshape.m4: Likewise. - * generated/reshape_c10.c: Regenerated. - * generated/reshape_c16.c: Regenerated. - * generated/reshape_c4.c: Regenerated. - * generated/reshape_c8.c: Regenerated. - * generated/reshape_i16.c: Regenerated. - * generated/reshape_i4.c: Regenerated. - * generated/reshape_i8.c: Regenerated. - * generated/reshape_r10.c: Regenerated. - * generated/reshape_r16.c: Regenerated. - * generated/reshape_r4.c: Regenerated. - * generated/reshape_r8.c: Regenerated. - * generated/spread_r4.c: Regenerated. + * generated/reshape_c10.c: Regenerated. + * generated/reshape_c16.c: Regenerated. + * generated/reshape_c4.c: Regenerated. + * generated/reshape_c8.c: Regenerated. + * generated/reshape_i16.c: Regenerated. + * generated/reshape_i4.c: Regenerated. + * generated/reshape_i8.c: Regenerated. + * generated/reshape_r10.c: Regenerated. + * generated/reshape_r16.c: Regenerated. + * generated/reshape_r4.c: Regenerated. + * generated/reshape_r8.c: Regenerated. + * generated/spread_r4.c: Regenerated. 2008-10-13 Jerry DeLisle <jvdelisle@gcc.gnu.org @@ -550,7 +556,7 @@ than the sub-object. 2008-09-26 Peter O'Gorman <pogma@thewrittenword.com> - Steve Ellcey <sje@cup.hp.com> + Steve Ellcey <sje@cup.hp.com> * configure: Regenerate for new libtool. * Makefile.in: Ditto. diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 0d2650b50fa..4f8cbb535c4 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -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; } |