aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jblomqvi@cc.hut.fi>2005-06-18 20:09:28 +0000
committerFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-06-18 20:09:28 +0000
commit18f7bcee9b9c80f4260f5ccd3a6603742bc3d398 (patch)
treeb98611657cf582d51ede3abf82e19a3c0e43efb4 /libgfortran/io/unix.c
parent5b017a9e8de0329e1955a2d7c56513f99ae455a6 (diff)
* unix.c (stream_at_bof): Don't assume that all non-mmapped files
are non-seekable. (stream_at_eof): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@101164 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index f4ee889cdda..1158458879e 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -1298,10 +1298,10 @@ stream_at_bof (stream * s)
{
unix_stream *us;
- us = (unix_stream *) s;
+ if (!is_seekable (s))
+ return 0;
- if (!us->mmaped)
- return 0; /* File is not seekable */
+ us = (unix_stream *) s;
return us->logical_offset == 0;
}
@@ -1315,10 +1315,10 @@ stream_at_eof (stream * s)
{
unix_stream *us;
- us = (unix_stream *) s;
+ if (!is_seekable (s))
+ return 0;
- if (!us->mmaped)
- return 0; /* File is not seekable */
+ us = (unix_stream *) s;
return us->logical_offset == us->dirty_offset;
}