--- b/contrib/mtree/create.c +++ b/contrib/mtree/create.c @@ -84,13 +84,6 @@ static uid_t uid; static mode_t mode; static u_long flags; -#ifdef __FreeBSD__ -#define FTS_CONST const -#else -#define FTS_CONST -#endif - -static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); static void output(FILE *, int, int *, const char *, ...) __printflike(4, 5); static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, @@ -449,7 +442,7 @@ statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, * * Keep this in sync with nodecmp() in spec.c. */ -static int +int dcmp(const FTSENT *FTS_CONST *a, const FTSENT *FTS_CONST *b) { --- b/contrib/mtree/extern.h +++ b/contrib/mtree/extern.h @@ -59,11 +59,18 @@ enum flavor { F_NETBSD6 }; +#ifdef __FreeBSD__ +#define FTS_CONST const +#else +#define FTS_CONST +#endif + void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); int crc(int, u_int32_t *, u_int32_t *); void cwalk(FILE *); +int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); --- b/contrib/mtree/verify.c +++ b/contrib/mtree/verify.c @@ -86,7 +86,7 @@ vwalk(void) argv[0] = dot; argv[1] = NULL; - if ((t = fts_open(argv, ftsoptions, NULL)) == NULL) + if ((t = fts_open(argv, ftsoptions, dcmp)) == NULL) mtree_err("fts_open: %s", strerror(errno)); level = root; specdepth = rval = 0;