diff --git a/cf/roken-frag.m4 b/cf/roken-frag.m4 index f2ab8846d..fca48c608 100644 --- a/cf/roken-frag.m4 +++ b/cf/roken-frag.m4 @@ -439,6 +439,10 @@ AC_HAVE_STRUCT_FIELD(DIR, dd_fd, [#include #include #endif]) +AC_HAVE_STRUCT_FIELD(DIR, d_fd, [#include +#ifdef HAVE_DIRENT_H +#include +#endif]) AC_BROKEN2(inet_aton, [#ifdef HAVE_SYS_TYPES_H diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 3cecaeaea..3f6d1afa5 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -802,9 +802,11 @@ int rk_flock(int fd, int operation); #ifndef HAVE_DIRFD #ifdef HAVE_DIR_DD_FD #define dirfd(x) ((x)->dd_fd) +#elif defined(HAVE_DIR_D_FD) +#define dirfd(x) ((x)->d_fd) #else #ifndef _WIN32 /* Windows code never calls dirfd */ -#error Missing dirfd() and ->dd_fd +#error Missing dirfd() and ->dd_fd and ->d_fd #endif #endif #endif