mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-12 15:06:44 +02:00
This ensures that if there is an error in the definition of the PENDING_OUTPUT_N_BYTES expression, we'll find about it right away; that value is used only in the rare event that close_stdout's fclose fails with EBADF.
25 lines
336 B
C
25 lines
336 B
C
/* Ensure that __fpending works. */
|
|
|
|
#include <config.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "__fpending.h"
|
|
|
|
int
|
|
main ()
|
|
{
|
|
if (__fpending (stdout) != 0)
|
|
abort ();
|
|
|
|
fputs ("foo", stdout);
|
|
if (__fpending (stdout) != 3)
|
|
abort ();
|
|
|
|
fflush (stdout);
|
|
if (__fpending (stdout) != 0)
|
|
abort ();
|
|
|
|
exit (0);
|
|
}
|