Commit b68d2bed by Janne Blomqvist Committed by François-Xavier Coudert

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
parent 2d9474df
2005-06-18 Janne Blomqvist <jblomqvi@cc.hut.fi>
* 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 <coudert@clipper.ens.fr> 2005-06-18 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19155 PR libfortran/19155
......
...@@ -1298,10 +1298,10 @@ stream_at_bof (stream * s) ...@@ -1298,10 +1298,10 @@ stream_at_bof (stream * s)
{ {
unix_stream *us; unix_stream *us;
us = (unix_stream *) s; if (!is_seekable (s))
return 0;
if (!us->mmaped) us = (unix_stream *) s;
return 0; /* File is not seekable */
return us->logical_offset == 0; return us->logical_offset == 0;
} }
...@@ -1315,10 +1315,10 @@ stream_at_eof (stream * s) ...@@ -1315,10 +1315,10 @@ stream_at_eof (stream * s)
{ {
unix_stream *us; unix_stream *us;
us = (unix_stream *) s; if (!is_seekable (s))
return 0;
if (!us->mmaped) us = (unix_stream *) s;
return 0; /* File is not seekable */
return us->logical_offset == us->dirty_offset; return us->logical_offset == us->dirty_offset;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment