[patch, libgfortran] PR59419 Failing OPEN with FILE='xxx' and IOSTAT creates the file 'xxx'

Jerry DeLisle jvdelisle@charter.net
Sun Dec 15 22:14:00 GMT 2013


Hi all,

The attached patch fixes the problem by properly exiting when an error has
occurred rather then falling through and creating the file.

The patch also fixes a few other places I found after auditing all calls to
generate error in libgfortran/io.

I will conjure up a test case for this.

I have regression tested on X86-64 Linux.  OK for trunk?

Regards,

Jerry

2013-12-15  Jerry DeLisle  <jvdelisle@gcc.gnu>

	PR libfortran/59419
	* io/file_pos.c (st_rewind): Do proper return after
	generate_error.
	* io/open.c (edit_modes): Move action code inside block that
	checks for library ok. (new_unit): Do cleanup after error.
	(st_open): Do proper return after error.
	* io/transfer.c (data_transfer_init): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr59419.diff
Type: text/x-patch
Size: 3946 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20131215/adbb80b8/attachment.bin>


More information about the Fortran mailing list