summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/scandir64.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-20 13:19:36 -0400
committerMike Frysinger <vapier@gentoo.org>2009-07-20 13:19:36 -0400
commit75552ab845005d5b386d4c1383d9c10193168847 (patch)
treef2cbce375f646a4609ffc76660f5f90b97868aa6 /libc/misc/dirent/scandir64.c
parent41ea9da89530817441761dfc1f3c716c17d7ccb4 (diff)
dirent: push dirent type to prototypes
This syncs the dirent related functions with the glibc behavior -- rather than take void pointers everywhere, make the struct dirent pointers explicit in the API. After all, the functions themselves will cast the pointers to a dirent structure, so if it isn't as expected, people will crash. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/misc/dirent/scandir64.c')
-rw-r--r--libc/misc/dirent/scandir64.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c
index bbd452d50..3d2a250a4 100644
--- a/libc/misc/dirent/scandir64.c
+++ b/libc/misc/dirent/scandir64.c
@@ -30,15 +30,9 @@
#include <sys/types.h>
#include "dirstream.h"
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* libc_hidden_proto(opendir) */
-/* libc_hidden_proto(closedir) */
-/* libc_hidden_proto(qsort) */
-/* libc_hidden_proto(readdir64) */
-
int scandir64(const char *dir, struct dirent64 ***namelist,
int (*selector) (const struct dirent64 *),
- int (*compar) (const void *, const void *))
+ int (*compar) (const struct dirent64 **, const struct dirent64 **))
{
DIR *dp = opendir (dir);
struct dirent64 *current;
@@ -111,7 +105,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist,
/* Sort the list if we have a comparison function to sort with. */
if (compar != NULL)
- qsort (names, pos, sizeof (struct dirent64 *), compar);
+ qsort (names, pos, sizeof (struct dirent64 *), (comparison_fn_t) compar);
*namelist = names;
return pos;
}