diff --git a/configure.ac b/configure.ac index 629881a6..1a3ccdb8 100644 --- a/configure.ac +++ b/configure.ac @@ -160,7 +160,7 @@ AC_TRY_COMPILE([#include ], AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) -AC_CHECK_FUNC([pidfd_open], [enable_pidwait=yes], [ +AC_CHECK_FUNCS([pidfd_open], [enable_pidwait=yes], [ AC_MSG_CHECKING([for __NR_pidfd_open]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([ #include diff --git a/src/pgrep.c b/src/pgrep.c index c4ad5da3..1c15981c 100644 --- a/src/pgrep.c +++ b/src/pgrep.c @@ -38,9 +38,11 @@ #include #include -#if defined(ENABLE_PIDWAIT) && !defined(HAVE_PIDFD_OPEN) +#ifdef ENABLE_PIDWAIT #include +#ifndef HAVE_PIDFD_OPEN #include +#endif /* !HAVE_PIDFD_OPEN */ #endif /* EXIT_SUCCESS is 0 */