Skip to content

Use AC_CHECK_MEMBERS instead of AC_EGREP_HEADER #13048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/fastcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ int fcgi_listen(const char *path, int backlog)
sa.sa_unix.sun_family = AF_UNIX;
memcpy(sa.sa_unix.sun_path, path, path_len + 1);
sock_len = (size_t)(((struct sockaddr_un *)0)->sun_path) + path_len;
#ifdef HAVE_SOCKADDR_UN_SUN_LEN
#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
sa.sa_unix.sun_len = sock_len;
#endif
unlink(path);
Expand Down
8 changes: 2 additions & 6 deletions sapi/cgi/config9.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ AC_MSG_CHECKING(for CGI build)
if test "$PHP_CGI" != "no"; then
AC_MSG_RESULT(yes)

AC_MSG_CHECKING([for sun_len in sys/un.h])
AC_EGREP_HEADER([sun_len], [sys/un.h],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SOCKADDR_UN_SUN_LEN], [1],
[Define if sockaddr_un in sys/un.h contains a sun_len component])],
AC_MSG_RESULT([no]))
dnl BSD systems.
AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,,[#include <sys/un.h>])

AC_MSG_CHECKING([whether cross-process locking is required by accept()])
case "`uname -sr`" in
Expand Down