aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2009-07-17 22:40:23 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2009-07-17 22:40:23 +0300
commit217c4f5393976eb36dc759957cec82513c1f85e1 (patch)
tree3b7e875280b0d4f1359830ee122c4bd052dcc4a0
parent23b1a789fd78c9a5bd2957d2375fad585bb5e060 (diff)
downloadgcc-217c4f5393976eb36dc759957cec82513c1f85e1.zip
gcc-217c4f5393976eb36dc759957cec82513c1f85e1.tar.gz
gcc-217c4f5393976eb36dc759957cec82513c1f85e1.tar.bz2
When finalizing I/O transfer, set current_record to 0 before returning.
PR libfortran/40714 Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org> From-SVN: r149757
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/io/transfer.c6
2 files changed, 12 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 932c85e..2374683 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-17 Janne Blomqvist <jb@gcc.gnu.org>
+ Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/40714
+ * io/transfer.c (finalize_transfer): Set current_record to 0
+ before returning in case of error.
+
2009-07-12 Tobias Burnus <burnus@net-b.de>
PR libfortran/22423
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 7d833b7..59f88d4 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -3103,7 +3103,11 @@ finalize_transfer (st_parameter_dt *dtp)
}
if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
- return;
+ {
+ if (dtp->u.p.current_unit && current_mode (dtp) == UNFORMATTED_SEQUENTIAL)
+ dtp->u.p.current_unit->current_record = 0;
+ return;
+ }
if ((dtp->u.p.ionml != NULL)
&& (cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0)