summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/readdir.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-28 11:06:03 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-28 11:06:03 +0000
commit1e78eb0bd44caf57a234c49ff9b5193a977b6ad3 (patch)
tree5f48d2c9aeedfe8c04d989230427204f10f7e0ba /libc/misc/dirent/readdir.c
parent46de710e624b2e578d9adf3bf44de5513867fba3 (diff)
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
Diffstat (limited to 'libc/misc/dirent/readdir.c')
-rw-r--r--libc/misc/dirent/readdir.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libc/misc/dirent/readdir.c b/libc/misc/dirent/readdir.c
index d74f9abb7..8c5fd7f1a 100644
--- a/libc/misc/dirent/readdir.c
+++ b/libc/misc/dirent/readdir.c
@@ -5,8 +5,6 @@
#include <dirent.h>
#include "dirstream.h"
-extern int getdents __P ((unsigned int fd, struct dirent *dirp, unsigned int count));
-
struct dirent *readdir(DIR * dir)
{
@@ -25,7 +23,7 @@ struct dirent *readdir(DIR * dir)
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) {
de = NULL;
goto all_done;