summaryrefslogtreecommitdiffstats
path: root/bin/ls
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>2002-09-21 01:28:41 +0000
committerwollman <wollman@FreeBSD.org>2002-09-21 01:28:41 +0000
commitaa09d8b564991123518bbfec303c1ceb346fc27a (patch)
treec2d8e348e30a733b07a594d611c3ba17a5b0e689 /bin/ls
parentfb1a9a69958da45404a3596741ae5c78ba503d78 (diff)
downloadFreeBSD-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 'bin/ls')
-rw-r--r--bin/ls/ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 71158de..be19f36 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$");
static void display(FTSENT *, FTSENT *);
static u_quad_t makenines(u_long);
-static int mastercmp(const FTSENT **, const FTSENT **);
+static int mastercmp(const FTSENT * const *, const FTSENT * const *);
static void traverse(int, char **, int);
static void (*printfcn)(DISPLAY *);
@@ -759,7 +759,7 @@ display(FTSENT *p, FTSENT *list)
* All other levels use the sort function. Error entries remain unsorted.
*/
static int
-mastercmp(const FTSENT **a, const FTSENT **b)
+mastercmp(const FTSENT * const *a, const FTSENT * const *b)
{
int a_info, b_info;
OpenPOWER on IntegriCloud