]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/mdocml/test-fts.c
Update compiler-rt to trunk r224034. This brings a number of new
[FreeBSD/FreeBSD.git] / contrib / mdocml / test-fts.c
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <fts.h>
4 #include <stdio.h>
5
6 int
7 main(void)
8 {
9         const char      *argv[2];
10         FTS             *ftsp;
11         FTSENT          *entry;
12
13         argv[0] = ".";
14         argv[1] = (char *)NULL;
15
16         ftsp = fts_open((char * const *)argv,
17             FTS_PHYSICAL | FTS_NOCHDIR, NULL);
18
19         if (ftsp == NULL) {
20                 perror("fts_open");
21                 return(1);
22         }
23
24         entry = fts_read(ftsp);
25
26         if (entry == NULL) {
27                 perror("fts_read");
28                 return(1);
29         }
30
31         if (fts_set(ftsp, entry, FTS_SKIP) != 0) {
32                 perror("fts_set");
33                 return(1);
34         }
35
36         if (fts_close(ftsp) != 0) {
37                 perror("fts_close");
38                 return(1);
39         }
40
41         return(0);
42 }