[gfortran] Patch for potential bug in i/o library
Janne Blomqvist
jblomqvi@cc.hut.fi
Mon Jun 6 05:34:00 GMT 2005
On Mon, Jun 06, 2005 at 12:15:28AM +0300, Janne Blomqvist wrote:
> The patch itself is attached.
As a couple of perceptive people noticed, the patch itself actually
wasn't attached. Thanks for pointing it out. Here the patch really is.
--
Janne Blomqvist
-------------- next part --------------
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/unix.c,v
retrieving revision 1.27
diff -u -p -r1.27 unix.c
--- unix.c 30 May 2005 07:38:36 -0000 1.27
+++ unix.c 5 Jun 2005 20:46:27 -0000
@@ -1302,10 +1302,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;
}
@@ -1319,10 +1319,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;
}
More information about the Fortran
mailing list