Module Name: othersrc Committed By: lukem Date: Thu Nov 30 09:42:36 UTC 2023
Modified Files: othersrc/libexec/tnftpd/ls: ls.c Log Message: workaround FreeBSD <fts.h> changing fts_open()'s compar signature FreeBSD 5.2 changed fts_open()'s compar function signature by adding extra const to the pointer arguments, and compilers may complain about the mismatch. Add workaround if compiling for FreeBSD and its <fts.h>. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/ls/ls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: othersrc/libexec/tnftpd/ls/ls.c diff -u othersrc/libexec/tnftpd/ls/ls.c:1.5 othersrc/libexec/tnftpd/ls/ls.c:1.6 --- othersrc/libexec/tnftpd/ls/ls.c:1.5 Sun Mar 1 22:58:20 2009 +++ othersrc/libexec/tnftpd/ls/ls.c Thu Nov 30 09:42:36 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ls.c,v 1.5 2009/03/01 22:58:20 lukem Exp $ */ +/* $NetBSD: ls.c,v 1.6 2023/11/30 09:42:36 lukem Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94"; #else -__RCSID("$NetBSD: ls.c,v 1.5 2009/03/01 22:58:20 lukem Exp $"); +__RCSID("$NetBSD: ls.c,v 1.6 2023/11/30 09:42:36 lukem Exp $"); #endif #endif /* not lint */ @@ -73,7 +73,14 @@ __RCSID("$NetBSD: ls.c,v 1.5 2009/03/01 #include "extern.h" static void display(FTSENT *, FTSENT *); + +/* workaround FreeBSD <fts.h> changing fts_open()'s compar signature */ +#if defined(__FreeBSD__) && defined(USE_FTS_H) +static int mastercmp(const FTSENT * const *, const FTSENT * const *); +#else static int mastercmp(const FTSENT **, const FTSENT **); +#endif + static void traverse(int, char **, int); static void (*printfcn)(DISPLAY *); @@ -595,7 +602,11 @@ display(FTSENT *p, FTSENT *list) * All other levels use the sort function. Error entries remain unsorted. */ static int +#if defined(__FreeBSD__) && defined(USE_FTS_H) +mastercmp(const FTSENT * const *a, const FTSENT * const *b) +#else mastercmp(const FTSENT **a, const FTSENT **b) +#endif { int a_info, b_info;