From 07793e18801bcc5ae3b6e4b3e8131aa22c4ad0b9 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 10 Nov 2014 15:33:39 -0800 Subject: [PATCH] Remove HAVE_DIRENT_D_TYPE. Only Windows doesn't have it, and we don't build atree for Windows. Change-Id: Ib6e96be73340c36cdfcb3654ed540f690bf7550b --- core/combo/include/arch/darwin-x86/AndroidConfig.h | 5 ----- core/combo/include/arch/linux-arm/AndroidConfig.h | 5 ----- core/combo/include/arch/linux-arm64/AndroidConfig.h | 5 ----- core/combo/include/arch/linux-mips/AndroidConfig.h | 5 ----- core/combo/include/arch/linux-mips64/AndroidConfig.h | 5 ----- core/combo/include/arch/linux-x86/AndroidConfig.h | 5 ----- core/combo/include/arch/target_linux-x86/AndroidConfig.h | 5 ----- tools/atree/files.cpp | 9 +-------- tools/atree/fs.cpp | 7 ------- 9 files changed, 1 insertion(+), 50 deletions(-) diff --git a/core/combo/include/arch/darwin-x86/AndroidConfig.h b/core/combo/include/arch/darwin-x86/AndroidConfig.h index 9546f7a806..24e9dd0321 100644 --- a/core/combo/include/arch/darwin-x86/AndroidConfig.h +++ b/core/combo/include/arch/darwin-x86/AndroidConfig.h @@ -114,11 +114,6 @@ */ /* #define HAVE_MALLOC_H */ -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if we have madvise() in */ diff --git a/core/combo/include/arch/linux-arm/AndroidConfig.h b/core/combo/include/arch/linux-arm/AndroidConfig.h index 7b009b83ff..51850c6773 100644 --- a/core/combo/include/arch/linux-arm/AndroidConfig.h +++ b/core/combo/include/arch/linux-arm/AndroidConfig.h @@ -125,11 +125,6 @@ */ #define HAVE_MADVISE 1 -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if libc includes Android system properties implementation. */ diff --git a/core/combo/include/arch/linux-arm64/AndroidConfig.h b/core/combo/include/arch/linux-arm64/AndroidConfig.h index a15eaed141..a8cd9a9504 100644 --- a/core/combo/include/arch/linux-arm64/AndroidConfig.h +++ b/core/combo/include/arch/linux-arm64/AndroidConfig.h @@ -123,11 +123,6 @@ */ #define HAVE_MADVISE 1 -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if libc includes Android system properties implementation. */ diff --git a/core/combo/include/arch/linux-mips/AndroidConfig.h b/core/combo/include/arch/linux-mips/AndroidConfig.h index 42261cdcbe..6213ebac5f 100644 --- a/core/combo/include/arch/linux-mips/AndroidConfig.h +++ b/core/combo/include/arch/linux-mips/AndroidConfig.h @@ -165,11 +165,6 @@ */ #define HAVE_MADVISE 1 -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if libc includes Android system properties implementation. */ diff --git a/core/combo/include/arch/linux-mips64/AndroidConfig.h b/core/combo/include/arch/linux-mips64/AndroidConfig.h index 957baed6b6..a1248c5ab1 100644 --- a/core/combo/include/arch/linux-mips64/AndroidConfig.h +++ b/core/combo/include/arch/linux-mips64/AndroidConfig.h @@ -155,11 +155,6 @@ */ #define HAVE_MADVISE 1 -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if libc includes Android system properties implementation. */ diff --git a/core/combo/include/arch/linux-x86/AndroidConfig.h b/core/combo/include/arch/linux-x86/AndroidConfig.h index d8a94ca26f..1bbab4b6f8 100644 --- a/core/combo/include/arch/linux-x86/AndroidConfig.h +++ b/core/combo/include/arch/linux-x86/AndroidConfig.h @@ -121,11 +121,6 @@ */ #define HAVE_MADVISE 1 -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if system provides a system property server (should be * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES). diff --git a/core/combo/include/arch/target_linux-x86/AndroidConfig.h b/core/combo/include/arch/target_linux-x86/AndroidConfig.h index 920d4b5577..2ca324efa9 100644 --- a/core/combo/include/arch/target_linux-x86/AndroidConfig.h +++ b/core/combo/include/arch/target_linux-x86/AndroidConfig.h @@ -117,11 +117,6 @@ */ #define HAVE_MADVISE 1 -/* - * Define if dirent struct has d_type field - */ -#define HAVE_DIRENT_D_TYPE 1 - /* * Define if libc includes Android system properties implementation. */ diff --git a/tools/atree/files.cpp b/tools/atree/files.cpp index df3e987427..d945f589c2 100644 --- a/tools/atree/files.cpp +++ b/tools/atree/files.cpp @@ -447,14 +447,7 @@ list_dir(const string& path, const FileRecord& rec, continue; } string entry = path_append(path, ent->d_name); -#ifdef HAVE_DIRENT_D_TYPE - bool is_directory = (ent->d_type == DT_DIR); -#else - // If dirent.d_type is missing, then use stat instead - struct stat stat_buf; - stat(entry.c_str(), &stat_buf); - bool is_directory = S_ISDIR(stat_buf.st_mode); -#endif + bool is_directory = (ent->d_type == DT_DIR); add_more(entry, is_directory, rec, more); if (is_directory) { dirs.push_back(entry); diff --git a/tools/atree/fs.cpp b/tools/atree/fs.cpp index 9468cfd9bf..6cd080e875 100644 --- a/tools/atree/fs.cpp +++ b/tools/atree/fs.cpp @@ -63,14 +63,7 @@ remove_recursively(const string& path) string full = path; full += '/'; full += ent->d_name; -#ifdef HAVE_DIRENT_D_TYPE bool is_directory = (ent->d_type == DT_DIR); -#else - // If dirent.d_type is missing, then use stat instead - struct stat stat_buf; - stat(full.c_str(), &stat_buf); - bool is_directory = S_ISDIR(stat_buf.st_mode); -#endif if (is_directory) { dirs.push_back(full); } else {