summaryrefslogtreecommitdiffstats
path: root/bftw.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2015-07-19 12:15:56 -0400
committerTavian Barnes <tavianator@tavianator.com>2015-07-19 12:15:56 -0400
commit894a7e2c5a0cc763375002e089494228f810db99 (patch)
treea3a24447372071c11afe113baeaa1e4b75bfc512 /bftw.c
parent7363b627b13009477a55f8f1b7981e672101d20e (diff)
downloadbfs-894a7e2c5a0cc763375002e089494228f810db99.tar.xz
bftw: Assume struct dirent::d_type exists if DT_* are defined.
Only glibc defines _DIRENT_HAVE_D_TYPE, but other C libraries have d_type too. This should fix #3.
Diffstat (limited to 'bftw.c')
-rw-r--r--bftw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bftw.c b/bftw.c
index d310263..a541b10 100644
--- a/bftw.c
+++ b/bftw.c
@@ -428,7 +428,7 @@ int bftw(const char *dirpath, bftw_fn *fn, int nopenfd, int flags, void *ptr) {
int typeflag = BFTW_UNKNOWN;
-#ifdef _DIRENT_HAVE_D_TYPE
+#if defined(_DIRENT_HAVE_D_TYPE) || defined(DT_DIR)
switch (de->d_type) {
case DT_DIR:
typeflag = BFTW_D;