diff options
author | bdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-02 04:13:21 +0000 |
---|---|---|
committer | bdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-02 04:13:21 +0000 |
commit | b0ef000d4a799217cd0030ea37b59b2ea2a34a9f (patch) | |
tree | 306dab8076c065a717c4dae252792365f72e726b /libgfortran | |
parent | 771c1b5086e11a855c22349dabeacbbad45ad817 (diff) | |
download | gcc-b0ef000d4a799217cd0030ea37b59b2ea2a34a9f.tar.gz |
2004-12-02 Bud Davis <bdavis9659@comcast.net>
* io/inquire.c (inquire_via_unit): do not allow a direct access
file to be opened for sequential I/O.
* gfortran.dg/inquire.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91610 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/io/inquire.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 179ed9bf991..e90c0faa47e 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2004-12-02 Bud Davis <bdavis9659@comcast.net> + + * io/inquire.c (inquire_via_unit): do not allow a direct access + file to be opened for sequential I/O. + 2004-12-02 Steven G. Kargl <kargls@comcast.net> Paul Brook <paul@codesourcery.com> diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index 36957dde58f..a93f99dc170 100644 --- a/libgfortran/io/inquire.c +++ b/libgfortran/io/inquire.c @@ -73,8 +73,13 @@ inquire_via_unit (gfc_unit * u) if (ioparm.sequential != NULL) { - p = (u == NULL) ? inquire_sequential (NULL, 0) : - inquire_sequential (u->file, u->file_len); + /* disallow an open direct access file to be accessed + sequentially */ + if (u->flags.access==ACCESS_DIRECT) + p = "NO"; + else + p = (u == NULL) ? inquire_sequential (NULL, 0) : + inquire_sequential (u->file, u->file_len); cf_strcpy (ioparm.sequential, ioparm.sequential_len, p); } |