summaryrefslogtreecommitdiffstats
path: root/compat_fts.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat_fts.c')
-rw-r--r--compat_fts.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compat_fts.c b/compat_fts.c
index 87847927..01577f50 100644
--- a/compat_fts.c
+++ b/compat_fts.c
@@ -62,6 +62,8 @@ static int fts_palloc(FTS *, size_t);
static FTSENT *fts_sort(FTS *, FTSENT *, int);
static unsigned short fts_stat(FTS *, FTSENT *);
+typedef int (*qsort_compar_proto)(const void *, const void *);
+
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
@@ -585,7 +587,8 @@ fts_sort(FTS *sp, FTSENT *head, int nitems)
}
for (ap = sp->fts_array, p = head; p; p = p->fts_link)
*ap++ = p;
- qsort(sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+ qsort(sp->fts_array, nitems, sizeof(FTSENT *),
+ (qsort_compar_proto)sp->fts_compar);
for (head = *(ap = sp->fts_array); --nitems; ++ap)
ap[0]->fts_link = ap[1];
ap[0]->fts_link = NULL;