From cb09492adbe1e4187a6b9f80afdb8bc9637543b1 Mon Sep 17 00:00:00 2001 From: fxcoudert Date: Tue, 29 Mar 2005 08:37:32 +0000 Subject: [PATCH] PR libfortran/20163 * io/open.c (st_open): call library_end() before returning even if an error arises. * gfortran.dg/pr20163-2.f: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97153 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 10 +++++----- gcc/testsuite/gfortran.dg/pr20163-2.f | 5 +++++ libgfortran/ChangeLog | 7 +++++++ libgfortran/io/open.c | 3 +++ 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr20163-2.f diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 81ab1deb1fb4..73aa6eb1e100 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,14 +1,14 @@ +2005-03-28 Steve Ellcey + + PR target/19890 + * gcc.dg/20020219-1.c: Skip on IA64 HP-UX in ILP32 mode. + 2005-03-29 Dale Ranta Francois-Xavier Coudert PR libfortran/20163 * gfortran.dg/pr20163-2.f: New test. -2005-03-28 Steve Ellcey - - PR target/19890 - * gcc.dg/20020219-1.c: Skip on IA64 HP-UX in ILP32 mode. - 2005-03-28 Jan Hubicka PR middle-end/20635 diff --git a/gcc/testsuite/gfortran.dg/pr20163-2.f b/gcc/testsuite/gfortran.dg/pr20163-2.f new file mode 100644 index 000000000000..c0b2573ed93a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr20163-2.f @@ -0,0 +1,5 @@ + open(10,status="foo",err=100) + call abort + 100 continue + open(10,status="scratch") + end diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 32b5454827bf..edc23af6ce93 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2005-03-29 Dale Ranta + Francois-Xavier Coudert + + PR libfortran/20163 + * io/open.c (st_open): call library_end() before returning even if + an error arises. + 2005-03-25 Francois-Xavier Coudert PR libfortran/19678 diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 3d0e5bebe7af..82a862b7c47a 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -481,7 +481,10 @@ st_open (void) flags.position = POSITION_ASIS; if (ioparm.library_return != LIBRARY_OK) + { + library_end (); return; + } u = find_unit (ioparm.unit); -- 2.47.3