From 1e78eb0bd44caf57a234c49ff9b5193a977b6ad3 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 28 Jan 2003 11:06:03 +0000 Subject: Fix scandir64 to not free the wrong pieces of memory (which could and did cause segfaults) by adjusting the working scandir.c to the the 64 thing. Fix up potential for mismatches between the libc and kernel dirent structures, which could also cause ugly problems. -Erik --- libc/misc/dirent/readdir_r.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libc/misc/dirent/readdir_r.c') diff --git a/libc/misc/dirent/readdir_r.c b/libc/misc/dirent/readdir_r.c index 423dcb810..50bc9bb6d 100644 --- a/libc/misc/dirent/readdir_r.c +++ b/libc/misc/dirent/readdir_r.c @@ -5,8 +5,6 @@ #include #include "dirstream.h" -extern int getdents __P ((unsigned int fd, struct dirent *dirp, unsigned int count)); - int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result) { @@ -27,7 +25,7 @@ int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result) do { if (dir->dd_size <= dir->dd_nextloc) { /* read dir->dd_max bytes of directory entries. */ - bytes = getdents(dir->dd_fd, dir->dd_buf, dir->dd_max); + bytes = __getdents(dir->dd_fd, dir->dd_buf, dir->dd_max); if (bytes <= 0) { *result = NULL; ret = errno; -- cgit v1.2.3