2006-04-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 Apr 2006 02:04:58 +0000 (02:04 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 Apr 2006 02:04:58 +0000 (02:04 +0000)
commit46ca759c2a4e76679b3bc4957c816971c890e692
tree56765ca4fae2a288923031b5cf63053bc3ecf2ab
parentfe37d6940e5378f684a57dcb118082a6ff6d29d7
2006-04-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/20257
* io/io.h: Add prototypes for get_internal_unit and free_internal_unit.
* io/unit.c (get_internal_unit): Initialize unit number, not zero.
(free_internal_unit): New function to consolidate freeing memory.
(get_unit): Initialize internal_unit_desc to NULL when unit is
external.
* io/unix.c (mem_close): Check for not NULL before freeing memory.
* io/transfer.c (read_block): Reset bytes_left and skip error if unit
is preconnected and default record length is reached.
(read_block_direct): Ditto.
(write_block): Ditto.
(write_buf): Ditto.
(data_transfer_init): Only flush if not internal unit.
(finalize_transfer): Ditto and delete code to free memory used by
internal units.
(st_read_done): Use new function - free_internal_unit.
(st_write_done): Use new function - free_internal unit.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113190 138bc75d-0d04-0410-961f-82ee72b054a4
libgfortran/ChangeLog
libgfortran/io/io.h
libgfortran/io/transfer.c
libgfortran/io/unit.c
libgfortran/io/unix.c