OSDN Git Service

* unix.c (stream_at_bof): Don't assume that all non-mmapped files
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Jun 2005 20:09:28 +0000 (20:09 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Jun 2005 20:09:28 +0000 (20:09 +0000)
are non-seekable.
(stream_at_eof): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101164 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/io/unix.c

index 2e7a7a2..dceddf6 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        PR libfortran/19155
 2005-06-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/19155
index f4ee889..1158458 100644 (file)
@@ -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)
-    return 0;                  /* File is not seekable */
+  us = (unix_stream *) s;
 
   return us->logical_offset == 0;
 }
 
   return us->logical_offset == 0;
 }
@@ -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)
-    return 0;                  /* File is not seekable */
+  us = (unix_stream *) s;
 
   return us->logical_offset == us->dirty_offset;
 }
 
   return us->logical_offset == us->dirty_offset;
 }