blob: 4e6ffcc90bd85feaa29b4c8c9796f2a9b75c2ec8 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <stdio.h>
2#include <errno.h>
3
4static int
5do_test (void)
6{
7 FILE *fp = fopen ("/foobar_does_no_exit", "re");
8 if (fp != NULL)
9 {
10 /* A joker created this file. Ignore the test. */
11 fclose (fp);
12 return 0;
13 }
14
15 if (errno == ENOENT)
16 {
17 printf ("no bug\n");
18 return 0;
19 }
20
21 printf ("bug : expected ENOENT, got: %m\n");
22 return 1;
23}
24
25#define TEST_FUNCTION do_test ()
26#include "../test-skeleton.c"