From 0af3e8febd747827d959aa95501a8db4dbdb9db4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 5 Jul 2017 12:34:29 -0700 Subject: [PATCH] Fix d_ino/d_off types. Bug: http://b/63336806 Test: builds Change-Id: I781e7c66c41bcb772d49ce7c23aab185ddd5da1e --- libc/include/dirent.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libc/include/dirent.h b/libc/include/dirent.h index 3f9ad185f..ebcf0851d 100644 --- a/libc/include/dirent.h +++ b/libc/include/dirent.h @@ -31,6 +31,7 @@ #include #include +#include __BEGIN_DECLS @@ -46,17 +47,24 @@ __BEGIN_DECLS #define DT_WHT 14 #endif +#if defined(__LP64__) +#define __DIRENT64_INO_T ino_t +#else +#define __DIRENT64_INO_T uint64_t /* Historical accident. */ +#endif + #define __DIRENT64_BODY \ - uint64_t d_ino; \ - int64_t d_off; \ - unsigned short d_reclen; \ - unsigned char d_type; \ - char d_name[256]; \ + __DIRENT64_INO_T d_ino; \ + off64_t d_off; \ + unsigned short d_reclen; \ + unsigned char d_type; \ + char d_name[256]; \ struct dirent { __DIRENT64_BODY }; struct dirent64 { __DIRENT64_BODY }; #undef __DIRENT64_BODY +#undef __DIRENT64_INO_T /* glibc compatibility. */ #undef _DIRENT_HAVE_D_NAMLEN /* Linux doesn't have a d_namlen field. */ -- 2.11.0