summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/common/bits/dirent.h8
-rw-r--r--libc/sysdeps/linux/common/getdents.c10
-rw-r--r--libc/sysdeps/linux/common/getdents64.c12
3 files changed, 12 insertions, 18 deletions
diff --git a/libc/sysdeps/linux/common/bits/dirent.h b/libc/sysdeps/linux/common/bits/dirent.h
index fb40e99cb..76794b08d 100644
--- a/libc/sysdeps/linux/common/bits/dirent.h
+++ b/libc/sysdeps/linux/common/bits/dirent.h
@@ -30,9 +30,7 @@ struct dirent
__off64_t d_off;
#endif
unsigned short int d_reclen;
-#ifdef __USE_FILE_OFFSET64
unsigned char d_type;
-#endif
char d_name[256]; /* We must not include limits.h! */
};
@@ -52,8 +50,4 @@ struct dirent64
#undef _DIRENT_HAVE_D_NAMLEN
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
-#ifdef __USE_FILE_OFFSET64
-# define _DIRENT_HAVE_D_TYPE
-#else
-# undef _DIRENT_HAVE_D_TYPE
-#endif
+#define _DIRENT_HAVE_D_TYPE
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);
diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c
index 53e57b351..a37f5e514 100644
--- a/libc/sysdeps/linux/common/getdents64.c
+++ b/libc/sysdeps/linux/common/getdents64.c
@@ -35,13 +35,13 @@
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-struct kernel_dirent64
+struct kernel_dirent64
{
- uint64_t d_ino;
- int64_t d_off;
- unsigned short int d_reclen;
- unsigned char d_type;
- char d_name[256];
+ uint64_t d_ino;
+ int64_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
};