re PR libfortran/48960 (OPEN statement modifies NEWUNIT variable on error)
2012-12-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/48960 * io/open.c (st_parameter_open): Assign newunit number to user variable only if the the associated open statement is successful. From-SVN: r194724
This commit is contained in:
parent
b4b575ce78
commit
4e766b5d40
|
@ -1,3 +1,9 @@
|
||||||
|
2012-12-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR libfortran/48960
|
||||||
|
* io/open.c (st_parameter_open): Assign newunit number to user
|
||||||
|
variable only if the the associated open statement is successful.
|
||||||
|
|
||||||
2012-12-26 Janne Blomqvist <jb@gcc.gnu.org>
|
2012-12-26 Janne Blomqvist <jb@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/55539
|
PR fortran/55539
|
||||||
|
|
|
@ -844,10 +844,7 @@ st_open (st_parameter_open *opp)
|
||||||
if ((opp->common.flags & IOPARM_LIBRETURN_MASK) == IOPARM_LIBRETURN_OK)
|
if ((opp->common.flags & IOPARM_LIBRETURN_MASK) == IOPARM_LIBRETURN_OK)
|
||||||
{
|
{
|
||||||
if ((opp->common.flags & IOPARM_OPEN_HAS_NEWUNIT))
|
if ((opp->common.flags & IOPARM_OPEN_HAS_NEWUNIT))
|
||||||
{
|
opp->common.unit = get_unique_unit_number(opp);
|
||||||
*opp->newunit = get_unique_unit_number(opp);
|
|
||||||
opp->common.unit = *opp->newunit;
|
|
||||||
}
|
|
||||||
|
|
||||||
u = find_or_create_unit (opp->common.unit);
|
u = find_or_create_unit (opp->common.unit);
|
||||||
if (u->s == NULL)
|
if (u->s == NULL)
|
||||||
|
@ -860,5 +857,9 @@ st_open (st_parameter_open *opp)
|
||||||
already_open (opp, u, &flags);
|
already_open (opp, u, &flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((opp->common.flags & IOPARM_OPEN_HAS_NEWUNIT)
|
||||||
|
&& (opp->common.flags & IOPARM_LIBRETURN_MASK) == IOPARM_LIBRETURN_OK)
|
||||||
|
*opp->newunit = opp->common.unit;
|
||||||
|
|
||||||
library_end ();
|
library_end ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue