mirror of
https://gitlab.com/procps-ng/procps.git
synced 2024-11-23 10:03:52 +08:00
fix pifd_open check
Replace AC_CHECK_FUNC by AC_CHECK_FUNCS otherwise HAVE_PIDFD_OPEN will
never be defined resulting in the following build failure if pidfd_open
is available but __NR_pidfd_open is not available:
pgrep.c: In function 'pidfd_open':
pgrep.c:748:17: error: '__NR_pidfd_open' undeclared (first use in this function); did you mean 'pidfd_open'?
748 | return syscall(__NR_pidfd_open, pid, flags);
| ^~~~~~~~~~~~~~~
| pidfd_open
This build failure is raised since the addition of pwait in version
3.3.17 and
c8384e682c
Fixes:
- http://autobuild.buildroot.org/results/f23a5156e641b2ebdd673973dec0f9c87760c688
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
parent
d99c213af9
commit
17f94796a9
@ -160,7 +160,7 @@ AC_TRY_COMPILE([#include <errno.h>],
|
||||
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 <sys/syscall.h>
|
||||
|
@ -38,9 +38,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(ENABLE_PIDWAIT) && !defined(HAVE_PIDFD_OPEN)
|
||||
#ifdef ENABLE_PIDWAIT
|
||||
#include <sys/epoll.h>
|
||||
#ifndef HAVE_PIDFD_OPEN
|
||||
#include <sys/syscall.h>
|
||||
#endif /* !HAVE_PIDFD_OPEN */
|
||||
#endif
|
||||
|
||||
/* EXIT_SUCCESS is 0 */
|
||||
|
Loading…
Reference in New Issue
Block a user