From bbfe3d55df0a20b929ed68173456f64f9ffa64e5 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 27 Feb 2024 10:01:43 +0100 Subject: [PATCH] Simplify port_create Autoconf check Similar simplification as e72f0c887bad4070a55529bf6e5cd1930b7ee8cb. --- sapi/fpm/config.m4 | 23 +---------------------- sapi/fpm/fpm/events/port.c | 12 ++++++------ 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index 584eb4db044bc..cebc9a4c78ff0 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -352,27 +352,6 @@ AC_DEFUN([AC_FPM_KQUEUE], ]) ]) -AC_DEFUN([AC_FPM_PORT], -[ - AC_MSG_CHECKING([for port framework]) - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - ]], [[ - int port; - - port = port_create(); - if (port < 0) { - return 1; - } - ]])], [ - AC_DEFINE([HAVE_PORT], 1, [do we have port framework?]) - AC_MSG_RESULT([yes]) - ], [ - AC_MSG_RESULT([no]) - ]) -]) - AC_DEFUN([AC_FPM_DEVPOLL], [ AC_MSG_CHECKING([for /dev/poll]) @@ -468,7 +447,6 @@ if test "$PHP_FPM" != "no"; then AC_FPM_BUILTIN_ATOMIC AC_FPM_LQ AC_FPM_KQUEUE - AC_FPM_PORT AC_FPM_DEVPOLL AC_FPM_EPOLL AC_FPM_SELECT @@ -477,6 +455,7 @@ if test "$PHP_FPM" != "no"; then AC_CHECK_HEADER([priv.h], [AC_CHECK_FUNCS([setpflags])]) AC_CHECK_HEADER([sys/times.h], [AC_CHECK_FUNCS([times])]) + AC_CHECK_HEADER([port.h], [AC_CHECK_FUNCS([port_create])]) PHP_ARG_WITH([fpm-user],, [AS_HELP_STRING([[--with-fpm-user[=USER]]], diff --git a/sapi/fpm/fpm/events/port.c b/sapi/fpm/fpm/events/port.c index 71810e45c6823..73cf24c82c2c2 100644 --- a/sapi/fpm/fpm/events/port.c +++ b/sapi/fpm/fpm/events/port.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#ifdef HAVE_PORT +#ifdef HAVE_PORT_CREATE #include #include @@ -45,19 +45,19 @@ port_event_t *events = NULL; int nevents = 0; static int pfd = -1; -#endif /* HAVE_PORT */ +#endif /* HAVE_PORT_CREATE */ struct fpm_event_module_s *fpm_event_port_module(void) /* {{{ */ { -#ifdef HAVE_PORT +#ifdef HAVE_PORT_CREATE return &port_module; #else return NULL; -#endif /* HAVE_PORT */ +#endif /* HAVE_PORT_CREATE */ } /* }}} */ -#ifdef HAVE_PORT +#ifdef HAVE_PORT_CREATE /* * Init the module @@ -196,4 +196,4 @@ static int fpm_event_port_remove(struct fpm_event_s *ev) /* {{{ */ } /* }}} */ -#endif /* HAVE_PORT */ +#endif /* HAVE_PORT_CREATE */