summaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-18 20:09:28 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-18 20:09:28 +0000
commit5df4b62febf4a92175add2e154726fc4ae5850a8 (patch)
treeb98611657cf582d51ede3abf82e19a3c0e43efb4 /libgfortran/io/unix.c
parentc44b9c58374637dd7b300bc52255a81ac120217b (diff)
downloadgcc-5df4b62febf4a92175add2e154726fc4ae5850a8.tar.gz
* unix.c (stream_at_bof): Don't assume that all non-mmapped files
are non-seekable. (stream_at_eof): Likewise. git-svn-id: svn+ssh://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;
}