1From d89d73c9c04e472479b2d2184beec506cc96e538 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Sat, 20 May 2023 11:09:36 +0800
4Subject: [PATCH] pgrep: Fix compile error with BSP 4.4 kernel
5
6Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
7---
8 configure.ac | 2 +-
9 pgrep.c      | 4 +++-
10 2 files changed, 4 insertions(+), 2 deletions(-)
11
12diff --git a/configure.ac b/configure.ac
13index 6417763..fe33be1 100644
14--- a/configure.ac
15+++ b/configure.ac
16@@ -325,7 +325,7 @@ then
17 fi
18 AC_SUBST(DEJAGNU)
19
20-AC_CHECK_FUNCS([__fpending alarm atexit dup2 gethostname getpagesize gettimeofday iswprint memchr memmove memset mkdir nl_langinfo putenv regcomp rpmatch select setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strndup strpbrk strrchr strspn strstr strtol strtoul strtoull strverscmp utmpname wcwidth])
21+AC_CHECK_FUNCS([__fpending alarm atexit dup2 gethostname getpagesize gettimeofday iswprint memchr memmove memset mkdir nl_langinfo pidfd_open putenv regcomp rpmatch select setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strndup strpbrk strrchr strspn strstr strtol strtoul strtoull strverscmp utmpname wcwidth])
22
23 AC_CONFIG_FILES([Makefile
24                  include/Makefile
25diff --git a/pgrep.c b/pgrep.c
26index 4fe5e8a..6353668 100644
27--- a/pgrep.c
28+++ b/pgrep.c
29@@ -38,10 +38,12 @@
30 #include <stdbool.h>
31 #include <time.h>
32
33-#if defined(ENABLE_PWAIT) && !defined(HAVE_PIDFD_OPEN)
34+#if defined(ENABLE_PWAIT)
35 #include <sys/epoll.h>
36+#if !defined(HAVE_PIDFD_OPEN)
37 #include <sys/syscall.h>
38 #endif
39+#endif
40
41 /* EXIT_SUCCESS is 0 */
42 /* EXIT_FAILURE is 1 */
43--
442.20.1
45
46