io.h (flush): Add prototype.

* io/io.h (flush): Add prototype.
	* io/transfer.c (finalize_transfer): Flush partial records.
	* io/unix.c (flush): New function.

From-SVN: r81913
This commit is contained in:
Janne Blomqvist 2004-05-16 16:27:48 +03:00 committed by Paul Brook
parent 1ab106cdc4
commit 000aa32a49
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2004-05-16 Janne Blomqvist <jblomqvi@cc.hut.fi>
* io/io.h (flush): Add prototype.
* io/transfer.c (finalize_transfer): Flush partial records.
* io/unix.c (flush): New function.
2004-05-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-05-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15234 PR fortran/15234

View File

@ -456,6 +456,9 @@ int is_seekable (stream *);
#define empty_internal_buffer prefix(empty_internal_buffer) #define empty_internal_buffer prefix(empty_internal_buffer)
void empty_internal_buffer(stream *); void empty_internal_buffer(stream *);
#define flush prefix(flush)
try flush (stream *);
/* unit.c */ /* unit.c */

View File

@ -1338,7 +1338,13 @@ finalize_transfer (void)
free_fnodes (); free_fnodes ();
if (advance_status == ADVANCE_NO) if (advance_status == ADVANCE_NO)
return; {
/* Most systems buffer lines, so force the partial record
to be written out. */
flush (current_unit->s);
return;
}
next_record (1); next_record (1);
current_unit->current_record = 0; current_unit->current_record = 0;
} }

View File

@ -1394,6 +1394,12 @@ is_seekable (stream * s)
return ((unix_stream *) s)->mmaped; return ((unix_stream *) s)->mmaped;
} }
try
flush (stream *s)
{
return fd_flush( (unix_stream *) s);
}
/* How files are stored: This is an operating-system specific issue, /* How files are stored: This is an operating-system specific issue,
and therefore belongs here. There are three cases to consider. and therefore belongs here. There are three cases to consider.