From 6d165d5c581d18b72ac266f92b0c02522a96785b Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 10 Feb 2003 21:15:20 +0000 Subject: We need to have the size of struct dirent equal to the size of struct dirent64 so when _FILE_OFFSET_BITS=64 (such that we transparently change 32bit into 64 bit interfaces), we will not lose an unsigned char from d_name which silently becomes the d_type field instead. oops. -Erik --- libc/sysdeps/linux/common/getdents.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libc/sysdeps/linux/common/getdents.c') diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 47d829454..ab6a276bb 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -34,10 +34,10 @@ struct kernel_dirent { - long int d_ino; - __kernel_off_t d_off; - unsigned short int d_reclen; - char d_name[256]; + long d_ino; + __kernel_off_t d_off; + unsigned short d_reclen; + char d_name[256]; }; #define __NR___syscall_getdents __NR_getdents @@ -90,7 +90,7 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes) dp->d_ino = kdp->d_ino; dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; - //dp->d_type = DT_UNKNOWN; + dp->d_type = DT_UNKNOWN; memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent, d_name)); dp = (struct dirent *) ((char *) dp + new_reclen); -- cgit v1.2.3