diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2011-10-31 16:45:50 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2011-10-31 16:45:50 +0200 |
commit | 7d5ee219357f0ec4e9d67285eec50677ff2583ce (patch) | |
tree | 041a48d3c01978c5d828f9408cf2ffcb1db07571 /libgfortran/io/intrinsics.c | |
parent | 2062f77b8b897691f102434aeec3253ad2ea28a5 (diff) | |
download | gcc-7d5ee219357f0ec4e9d67285eec50677ff2583ce.zip gcc-7d5ee219357f0ec4e9d67285eec50677ff2583ce.tar.gz gcc-7d5ee219357f0ec4e9d67285eec50677ff2583ce.tar.bz2 |
Simplify handling of special files.
2011-10-31 Janne Blomqvist <jb@gcc.gnu.org>
* io/file_pos.c (st_rewind): Handle regular and special files
identically.
* io/intrinsics.c (fseek_sub): Don't check whether we think the
file is seekable, just do what the caller says.
* io/transfer.c (skip_record): First try to seek, then fallback to
reading and throwing away what we read.
* io/unit.c (update_position): Don't check whether file is
seekable, just try to do what we're told.
(unit_truncate): Likewise.
* io/unix.c (struct unix_stream): Remove special_file flag.
(buf_flush): Remove code for handling unseekable files.
(buf_seek): Likewise.
(fd_to_stream): Use buffered IO only for regular files.
(file_length): Remove is_seekable() call.
(is_seekable): Remove function.
(is_special): Likewise.
* io/unix.h: Remove prototypes for is_seekable and is_special.
From-SVN: r180701
Diffstat (limited to 'libgfortran/io/intrinsics.c')
-rw-r--r-- | libgfortran/io/intrinsics.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c index f48bd77..c1287d4 100644 --- a/libgfortran/io/intrinsics.c +++ b/libgfortran/io/intrinsics.c @@ -246,7 +246,7 @@ fseek_sub (int * unit, GFC_IO_INT * offset, int * whence, int * status) gfc_unit * u = find_unit (*unit); ssize_t result = -1; - if (u != NULL && is_seekable(u->s)) + if (u != NULL) { result = sseek(u->s, *offset, *whence); |