diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-06 21:53:11 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-06 21:53:11 +0000 |
commit | fd64a0ea5d6f9ec2efd35fea0502e55598d6f638 (patch) | |
tree | 3aa6c043ee93c5bf756998c47a44cd51d59401ed /libgfortran | |
parent | 1e34298419a620070cd4098c0a48eec4b6066ea9 (diff) |
2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/38291
* io/transfer.c (data_transfer_init): Add fbuf_flush inadvertently
ommitted. Add check for invalid use of REC= with ACCESS="stream". Fix
comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142528 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/io/transfer.c | 16 |
2 files changed, 21 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 3fc0ca82288..765bbd78b3e 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/38291 + * io/transfer.c (data_transfer_init): Add fbuf_flush inadvertently + ommitted. Add check for invalid use of REC= with ACCESS="stream". Fix + comment. + 2008-12-06 Adam Nemet <anemet@caviumnetworks.com> * runtime/main.c (store_exe_path): Don't crash if argv0 is NULL. diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 4ddfd9f9a98..318d2215ee2 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1967,7 +1967,7 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) return; } - /* Check the record or position number. */ + /* Check the record number. */ if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT && (cf & IOPARM_DT_HAS_REC) == 0) @@ -1986,6 +1986,15 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) return; } + if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM + && (cf & IOPARM_DT_HAS_REC) != 0) + { + generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT, + "Record number not allowed for stream access " + "data transfer"); + return; + } + /* Process the ADVANCE option. */ dtp->u.p.advance_status @@ -2146,7 +2155,10 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) /* Required for compatibility between 4.3 and 4.4 runtime. Check to see if we might be reading what we wrote before */ if (dtp->u.p.current_unit->mode == WRITING) - flush(dtp->u.p.current_unit->s); + { + fbuf_flush (dtp->u.p.current_unit, 1); + flush(dtp->u.p.current_unit->s); + } if (dtp->pos < file_length (dtp->u.p.current_unit->s)) dtp->u.p.current_unit->endfile = NO_ENDFILE; |