11 char tmpl[] = "/tmp/tst-put-error.XXXXXX";
12 int fd = mkstemp (tmpl);
14 error (EXIT_FAILURE, errno, "cannot create temporary file");
15 FILE *fp = fdopen (fd, "w");
17 error (EXIT_FAILURE, errno, "fdopen");
21 int n = fprintf (fp, "hello world\n");
22 printf ("fprintf = %d\n", n);
24 error (EXIT_FAILURE, 0, "first fprintf succeeded");
25 n = fprintf (fp, "hello world\n");
26 printf ("fprintf = %d\n", n);
28 error (EXIT_FAILURE, 0, "second fprintf succeeded");
32 #define TEST_FUNCTION do_test ()
33 #include "../test-skeleton.c"