diff options
author | wollman <wollman@FreeBSD.org> | 2002-09-21 01:28:41 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 2002-09-21 01:28:41 +0000 |
commit | aa09d8b564991123518bbfec303c1ceb346fc27a (patch) | |
tree | c2d8e348e30a733b07a594d611c3ba17a5b0e689 /usr.sbin | |
parent | fb1a9a69958da45404a3596741ae5c78ba503d78 (diff) | |
download | FreeBSD-src-aa09d8b564991123518bbfec303c1ceb346fc27a.zip FreeBSD-src-aa09d8b564991123518bbfec303c1ceb346fc27a.tar.gz |
Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI. FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about. As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use. All callers in the
tree are updated to use the correct prototype.
Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.
Not objected to in spirit by: -arch
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c | 4 | ||||
-rw-r--r-- | usr.sbin/mtree/create.c | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/match.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c b/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c index b5a1411..783fd3f 100644 --- a/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c +++ b/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c @@ -53,7 +53,7 @@ #define DEFAULT_NUM 1 /* Default number of pieces mailed per run. */ -int fts_sort(const FTSENT **, const FTSENT **); +int fts_sort(const FTSENT * const *, const FTSENT * const *); int run_sendmail(int ifd); int @@ -156,7 +156,7 @@ main(int argc, char **argv) } int -fts_sort(const FTSENT ** a, const FTSENT ** b) +fts_sort(const FTSENT * const * a, const FTSENT * const * b) { if ((*a)->fts_info != FTS_F) return(0); diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index 3ab1602..ae82966 100644 --- a/usr.sbin/mtree/create.c +++ b/usr.sbin/mtree/create.c @@ -80,7 +80,7 @@ static uid_t uid; static mode_t mode; static u_long flags = 0xffffffff; -static int dsort(const FTSENT **, const FTSENT **); +static int dsort(const FTSENT * const *, const FTSENT * const *); static void output(int, int *, const char *, ...) __printflike(3, 4); static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); static void statf(int, FTSENT *); @@ -398,7 +398,7 @@ statd(t, parent, puid, pgid, pmode, pflags) static int dsort(a, b) - const FTSENT **a, **b; + const FTSENT * const *a, * const *b; { if (S_ISDIR((*a)->fts_statp->st_mode)) { if (!S_ISDIR((*b)->fts_statp->st_mode)) diff --git a/usr.sbin/pkg_install/lib/match.c b/usr.sbin/pkg_install/lib/match.c index cf745c3..5312c27 100644 --- a/usr.sbin/pkg_install/lib/match.c +++ b/usr.sbin/pkg_install/lib/match.c @@ -40,7 +40,7 @@ struct store { static int rex_match(const char *, const char *); struct store *storecreate(struct store *); static int storeappend(struct store *, const char *); -static int fname_cmp(const FTSENT **, const FTSENT **); +static int fname_cmp(const FTSENT * const *, const FTSENT * const *); /* * Function to query names of installed packages. @@ -337,7 +337,7 @@ storeappend(struct store *store, const char *item) } static int -fname_cmp(const FTSENT **a, const FTSENT **b) +fname_cmp(const FTSENT * const *a, const FTSENT * const *b) { return strcmp((*a)->fts_name, (*b)->fts_name); } |