Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Oct 2022 06:16:49 GMT
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8ee42190e198 - stable/12 - scandir(3): Rename alphasort_thunk to scandir_thunk_cmp to reflect that it is not alphasort-specific.
Message-ID:  <202210050616.2956Gncv082685@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by delphij:

URL: https://cgit.FreeBSD.org/src/commit/?id=8ee42190e198441048f928439cf391338ec4c2cb

commit 8ee42190e198441048f928439cf391338ec4c2cb
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2022-09-26 02:01:46 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2022-10-05 06:16:40 +0000

    scandir(3): Rename alphasort_thunk to scandir_thunk_cmp to
    reflect that it is not alphasort-specific.
    
    Reported by:    emaste
    Reviewed by:    emaste
    Differential Revision: https://reviews.freebsd.org/D36708
    
    (cherry picked from commit 45ff071ddccac0a158cfeb53285e6bb2df6bc835)
---
 lib/libc/gen/scandir-compat11.c | 6 +++---
 lib/libc/gen/scandir.c          | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/libc/gen/scandir-compat11.c b/lib/libc/gen/scandir-compat11.c
index 2c86b548f1d9..e6af1929a4d2 100644
--- a/lib/libc/gen/scandir-compat11.c
+++ b/lib/libc/gen/scandir-compat11.c
@@ -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
@@ -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);
 
@@ -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 **);
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 10cd7633dac1..aac5e7970777 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -61,7 +61,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
 
 int
@@ -125,7 +125,7 @@ scandir(const char *dirname, 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);
@@ -151,7 +151,7 @@ alphasort(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 **);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210050616.2956Gncv082685>