Home | History | Annotate | Download | only in lib

Lines Matching full:stream

1 /* Close a stream, with nicer error checking than fclose's.
20 #include "close-stream.h"
31 /* Close STREAM. Return 0 if successful, EOF (setting errno)
39 If a program writes *anything* to STREAM, that program should close
40 STREAM and make sure that it succeeds before exiting. Otherwise,
42 of every function that does an explicit write to STREAM. The last
43 printf can succeed in writing to the internal stream buffer, and yet
44 the fclose(STREAM) could still fail (due e.g., to a disk full error)
52 that writes to STREAM -- just let the internal stream state record
56 close_stream (FILE *stream)
58 const bool some_pending = (__fpending (stream) != 0);
59 const bool prev_fail = (ferror (stream) != 0);
60 const bool fclose_fail = (fclose (stream) != 0);