2017-12-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
commit7d9dac31fe56605bbd145498ef2532bd212a515f
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Dec 2017 02:30:49 +0000 (14 02:30 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Dec 2017 02:30:49 +0000 (14 02:30 +0000)
tree5f68781b01180ebf39912f3254d5c1028b162c6c
parent349c228768e5f626fb6d383bcd7cd9f9064d6b42
2017-12-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/78549
        * io/inquire.c (inquire_via_unit): Adjust test for existence for
        pre-connected internal units.
        * io/transfer.c (finalize_transfer): When done with a transfer
        to internal units, free the format buffer and close the stream.
        (st_read_done): Delete freeing the stream, now handled using
        sclose in finalize_transfer. (st_write_done): Likewise.
        * io/unit.c (get_unit): Return NULL for special reserved unit
        numbers, signifying not accessible to the user.
        (init_units): Insert the two special internal units into the
        unit treap. This makes these unit structures available without
        further allocations for later use by internal unit I/O. These
        units are automatically deleted by normal program termination.
        * io/unix.c (mem_close): Add a guard check to protect from double free.

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