Wed Apr 24 01:44:51 2024 UTC (16d)
For the NetBSD tools build we provide our own fts.h not FreeBSD's so the
comparator should have the NetBSD signature.


(christos)
diff -r1.77 -r1.78 src/usr.sbin/mtree/create.c

cvs diff -r1.77 -r1.78 src/usr.sbin/mtree/create.c (expand / switch to unified diff)

--- src/usr.sbin/mtree/create.c 2023/12/02 13:34:48 1.77
+++ src/usr.sbin/mtree/create.c 2024/04/24 01:44:51 1.78
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: create.c,v 1.77 2023/12/02 13:34:48 christos Exp $ */ 1/* $NetBSD: create.c,v 1.78 2024/04/24 01:44:51 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1989, 1993 4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#if defined(__RCSID) && !defined(lint) 37#if defined(__RCSID) && !defined(lint)
38#if 0 38#if 0
39static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; 39static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93";
40#else 40#else
41__RCSID("$NetBSD: create.c,v 1.77 2023/12/02 13:34:48 christos Exp $"); 41__RCSID("$NetBSD: create.c,v 1.78 2024/04/24 01:44:51 christos Exp $");
42#endif 42#endif
43#endif /* not lint */ 43#endif /* not lint */
44 44
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/stat.h> 46#include <sys/stat.h>
47 47
48#if ! HAVE_NBTOOL_CONFIG_H 48#if ! HAVE_NBTOOL_CONFIG_H
49#include <dirent.h> 49#include <dirent.h>
50#endif 50#endif
51 51
52#include <errno.h> 52#include <errno.h>
53#include <fcntl.h> 53#include <fcntl.h>
54#include <grp.h> 54#include <grp.h>
@@ -74,27 +74,27 @@ __RCSID("$NetBSD: create.c,v 1.77 2023/1 @@ -74,27 +74,27 @@ __RCSID("$NetBSD: create.c,v 1.77 2023/1
74#include <sha2.h> 74#include <sha2.h>
75#endif 75#endif
76 76
77#include "extern.h" 77#include "extern.h"
78 78
79#define INDENTNAMELEN 15 79#define INDENTNAMELEN 15
80#define MAXLINELEN 80 80#define MAXLINELEN 80
81 81
82static gid_t gid; 82static gid_t gid;
83static uid_t uid; 83static uid_t uid;
84static mode_t mode; 84static mode_t mode;
85static u_long flags; 85static u_long flags;
86 86
87#ifdef __FreeBSD__ 87#if defined(__FreeBSD__) && !defined(HAVE_NBTOOL_CONFIG_H)
88#define FTS_CONST const 88#define FTS_CONST const
89#else 89#else
90#define FTS_CONST 90#define FTS_CONST
91#endif 91#endif
92 92
93static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); 93static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *);
94static void output(FILE *, int, int *, const char *, ...) 94static void output(FILE *, int, int *, const char *, ...)
95 __printflike(4, 5); 95 __printflike(4, 5);
96static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, 96static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *,
97 u_long *); 97 u_long *);
98static void statf(FILE *, int, FTSENT *); 98static void statf(FILE *, int, FTSENT *);
99 99
100void 100void