X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fstdio%2Ffflush.c;h=b8d32ec307d45b389d3a0fa37fb79263998e9f16;hp=5118503c530e413232e79dc8ece526356597ccf0;hb=0d54a75af25ca44411e7c4190cc2a93a390e61a2;hpb=18af9d0a4cd252433e0cbd5daf4640e325c9d0ab diff --git a/functions/stdio/fflush.c b/functions/stdio/fflush.c index 5118503..b8d32ec 100644 --- a/functions/stdio/fflush.c +++ b/functions/stdio/fflush.c @@ -22,9 +22,12 @@ int fflush( struct _PDCLIB_file_t * stream ) int rc = 0; while ( stream != NULL ) { - if ( stream->bufidx > stream->bufend ) + if ( stream->status & _PDCLIB_FWRITE ) { - rc |= _PDCLIB_fflush( stream ); + if ( _PDCLIB_flushbuffer( stream ) == EOF ) + { + rc = EOF; + } } stream = stream->next; } @@ -32,7 +35,7 @@ int fflush( struct _PDCLIB_file_t * stream ) } else { - return _PDCLIB_fflush( stream ); + return _PDCLIB_flushbuffer( stream ); } } @@ -43,7 +46,7 @@ int fflush( struct _PDCLIB_file_t * stream ) int main( void ) { - TESTCASE( NO_TESTDRIVER ); + /* Testing covered by ftell.c */ return TEST_RESULTS; }