From 894a7e2c5a0cc763375002e089494228f810db99 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 19 Jul 2015 12:15:56 -0400 Subject: 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. --- bftw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3