From b68d2bed0dfa9f2bd4a5716de8c6f1636e2344de Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Sat, 18 Jun 2005 23:09:28 +0300 Subject: [PATCH] unix.c (stream_at_bof): Don't assume that all non-mmapped files are non-seekable. * unix.c (stream_at_bof): Don't assume that all non-mmapped files are non-seekable. (stream_at_eof): Likewise. From-SVN: r101164 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/unix.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 2e7a7a2..dceddf6 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2005-06-18 Janne Blomqvist + + * unix.c (stream_at_bof): Don't assume that all non-mmapped files + are non-seekable. + (stream_at_eof): Likewise. + 2005-06-18 Francois-Xavier Coudert PR libfortran/19155 diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index f4ee889..1158458 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; } -- 2.7.4