Skip to content

Commit

Permalink
scandir(3): Rename alphasort_thunk to scandir_thunk_cmp to
Browse files Browse the repository at this point in the history
reflect that it is not alphasort-specific.

Reported by:	emaste
Reviewed by:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D36708
  • Loading branch information
delphij committed Sep 26, 2022
1 parent 1a2b557 commit 45ff071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/libc/gen/scandir-compat11.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");

#define SELECT(x) select(x)

static int freebsd11_alphasort_thunk(void *thunk, const void *p1,
static int freebsd11_scandir_thunk_cmp(void *thunk, const void *p1,
const void *p2);

int
Expand Down Expand Up @@ -116,7 +116,7 @@ freebsd11_scandir(const char *dirname, struct freebsd11_dirent ***namelist,
closedir(dirp);
if (numitems && dcomp != NULL)
qsort_r(names, numitems, sizeof(struct freebsd11_dirent *),
&dcomp, freebsd11_alphasort_thunk);
&dcomp, freebsd11_scandir_thunk_cmp);
*namelist = names;
return (numitems);

Expand All @@ -141,7 +141,7 @@ freebsd11_alphasort(const struct freebsd11_dirent **d1,
}

static int
freebsd11_alphasort_thunk(void *thunk, const void *p1, const void *p2)
freebsd11_scandir_thunk_cmp(void *thunk, const void *p1, const void *p2)
{
int (*dc)(const struct freebsd11_dirent **, const struct
freebsd11_dirent **);
Expand Down
6 changes: 3 additions & 3 deletions lib/libc/gen/scandir.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ typedef DECLARE_BLOCK(int, select_block, const struct dirent *);
typedef DECLARE_BLOCK(int, dcomp_block, const struct dirent **,
const struct dirent **);
#else
static int alphasort_thunk(void *thunk, const void *p1, const void *p2);
static int scandir_thunk_cmp(void *thunk, const void *p1, const void *p2);
#endif

static int
Expand Down Expand Up @@ -123,7 +123,7 @@ scandir_dirp(DIR *dirp, struct dirent ***namelist,
qsort_b(names, numitems, sizeof(struct dirent *), (void*)dcomp);
#else
qsort_r(names, numitems, sizeof(struct dirent *),
&dcomp, alphasort_thunk);
&dcomp, scandir_thunk_cmp);
#endif
*namelist = names;
return (numitems);
Expand Down Expand Up @@ -199,7 +199,7 @@ versionsort(const struct dirent **d1, const struct dirent **d2)
}

static int
alphasort_thunk(void *thunk, const void *p1, const void *p2)
scandir_thunk_cmp(void *thunk, const void *p1, const void *p2)
{
int (*dc)(const struct dirent **, const struct dirent **);

Expand Down

0 comments on commit 45ff071

Please sign in to comment.