aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-03-18 18:13:50 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-03-18 18:13:50 +0000
commit7ab8aa36203ef49ae94f239ca6b148ac99922e46 (patch)
tree871476a5899e38bd7a956355df12cf05c6dd4f79 /libgfortran/io/unix.c
parent7453378e3d16d7b048668ec46ab93f7bb9043308 (diff)
downloadgcc-7ab8aa36203ef49ae94f239ca6b148ac99922e46.zip
gcc-7ab8aa36203ef49ae94f239ca6b148ac99922e46.tar.gz
gcc-7ab8aa36203ef49ae94f239ca6b148ac99922e46.tar.bz2
re PR libfortran/31052 ([4.2 only] Bad IOSTAT values when readings NAMELISTs past EOF)
2007-03-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/31052 * io/file_position (st_rewind): Fix comments. Remove use of test_endfile. Don't seek if already at 0 position. Use new is_special function to set endfile state. * io/open.c (test_endfile): Delete this function. * io/io.h: Delete prototype for test_endfile. Add prototype for is_special. * io/unix.c (is_special): New function. Fix whitespace. * io/transfer.c (next_record_r): Remove use of test_endfile. From-SVN: r123038
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index b58df51..4b9d87f 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -1872,7 +1872,7 @@ file_length (stream * s)
/* file_position()-- Return the current position of the file */
gfc_offset
-file_position (stream * s)
+file_position (stream *s)
{
return ((unix_stream *) s)->logical_offset;
}
@@ -1882,13 +1882,22 @@ file_position (stream * s)
* it is not */
int
-is_seekable (stream * s)
+is_seekable (stream *s)
{
/* By convention, if file_length == -1, the file is not
seekable. */
return ((unix_stream *) s)->file_length!=-1;
}
+
+/* is_special()-- Return nonzero if the stream is not a regular file. */
+
+is_special (stream *s)
+{
+ return ((unix_stream *) s)->special_file;
+}
+
+
try
flush (stream *s)
{