Merge "Remove HAVE_DIRENT_D_TYPE."
This commit is contained in:
commit
83da486c37
|
@ -114,11 +114,6 @@
|
||||||
*/
|
*/
|
||||||
/* #define HAVE_MALLOC_H */
|
/* #define HAVE_MALLOC_H */
|
||||||
|
|
||||||
/*
|
|
||||||
* Define if dirent struct has d_type field
|
|
||||||
*/
|
|
||||||
#define HAVE_DIRENT_D_TYPE 1
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define if we have madvise() in <sys/mman.h>
|
* Define if we have madvise() in <sys/mman.h>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -125,11 +125,6 @@
|
||||||
*/
|
*/
|
||||||
#define HAVE_MADVISE 1
|
#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.
|
* Define if libc includes Android system properties implementation.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -123,11 +123,6 @@
|
||||||
*/
|
*/
|
||||||
#define HAVE_MADVISE 1
|
#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.
|
* Define if libc includes Android system properties implementation.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -165,11 +165,6 @@
|
||||||
*/
|
*/
|
||||||
#define HAVE_MADVISE 1
|
#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.
|
* Define if libc includes Android system properties implementation.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -155,11 +155,6 @@
|
||||||
*/
|
*/
|
||||||
#define HAVE_MADVISE 1
|
#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.
|
* Define if libc includes Android system properties implementation.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -121,11 +121,6 @@
|
||||||
*/
|
*/
|
||||||
#define HAVE_MADVISE 1
|
#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
|
* Define if system provides a system property server (should be
|
||||||
* mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
|
* mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
|
||||||
|
|
|
@ -117,11 +117,6 @@
|
||||||
*/
|
*/
|
||||||
#define HAVE_MADVISE 1
|
#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.
|
* Define if libc includes Android system properties implementation.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -447,14 +447,7 @@ list_dir(const string& path, const FileRecord& rec,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
string entry = path_append(path, ent->d_name);
|
string entry = path_append(path, ent->d_name);
|
||||||
#ifdef HAVE_DIRENT_D_TYPE
|
bool is_directory = (ent->d_type == DT_DIR);
|
||||||
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
|
|
||||||
add_more(entry, is_directory, rec, more);
|
add_more(entry, is_directory, rec, more);
|
||||||
if (is_directory) {
|
if (is_directory) {
|
||||||
dirs.push_back(entry);
|
dirs.push_back(entry);
|
||||||
|
|
|
@ -63,14 +63,7 @@ remove_recursively(const string& path)
|
||||||
string full = path;
|
string full = path;
|
||||||
full += '/';
|
full += '/';
|
||||||
full += ent->d_name;
|
full += ent->d_name;
|
||||||
#ifdef HAVE_DIRENT_D_TYPE
|
|
||||||
bool is_directory = (ent->d_type == DT_DIR);
|
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) {
|
if (is_directory) {
|
||||||
dirs.push_back(full);
|
dirs.push_back(full);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue