From d6f3c9b14ab1e8d244a05bd9e6a29e938b04f5d3 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 7 Apr 2003 06:28:30 +0000 Subject: [PATCH] MSGHDR updates --- build/openldap.m4 | 14 ++++------- configure | 63 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/build/openldap.m4 b/build/openldap.m4 index 26b2458e21..411115b602 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -1219,13 +1219,9 @@ AC_DEFUN([OL_SASL_COMPAT], dnl ==================================================================== dnl check for msg_accrights in msghdr AC_DEFUN(OL_MSGHDR_MSG_ACCRIGHTS, - [AC_CACHE_CHECK(for msg_accrights in msghdr, ol_cv_msghdr_msg_accrights, - [AC_TRY_COMPILE([#include ], - [struct msghdr m; m.msg_accrightslen=0], - ol_cv_msghdr_msg_accrights=yes, ol_cv_msghdr_msg_accrights=no) - ]) - if test $ol_cv_msghdr_msg_accrights = "yes" ; then - AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1, - [define if struct msghdr has msg_accrights]) - fi + [AC_CHECK_MEMBER(struct msghdr.msg_accrights,,,[#include ]) + if test $ac_cv_member_struct_msghdr_msg_accrights = "yes" ; then + AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1, + [define if struct msghdr has msg_accrights]) + fi ])dnl diff --git a/configure b/configure index 2f76733590..3c18203401 100755 --- a/configure +++ b/configure @@ -32495,9 +32495,9 @@ if test "$ac_cv_func_getopt" != yes; then LIBSRCS="$LIBSRCS getopt.c" fi if test "$ac_cv_func_getpeereid" != yes; then - echo "$as_me:$LINENO: checking for msg_accrights in msghdr" >&5 -echo $ECHO_N "checking for msg_accrights in msghdr... $ECHO_C" >&6 -if test "${ol_cv_msghdr_msg_accrights+set}" = set; then + echo "$as_me:$LINENO: checking for struct msghdr.msg_accrights" >&5 +echo $ECHO_N "checking for struct msghdr.msg_accrights... $ECHO_C" >&6 +if test "${ac_cv_member_struct_msghdr_msg_accrights+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -32508,10 +32508,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include + +int +main () +{ +static struct msghdr ac_aggr; +if (ac_aggr.msg_accrights) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_msghdr_msg_accrights=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + int main () { -struct msghdr m; m.msg_accrightslen=0 +static struct msghdr ac_aggr; +if (sizeof ac_aggr.msg_accrights) +return 0; ; return 0; } @@ -32528,25 +32567,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ol_cv_msghdr_msg_accrights=yes + ac_cv_member_struct_msghdr_msg_accrights=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ol_cv_msghdr_msg_accrights=no +ac_cv_member_struct_msghdr_msg_accrights=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext - fi -echo "$as_me:$LINENO: result: $ol_cv_msghdr_msg_accrights" >&5 -echo "${ECHO_T}$ol_cv_msghdr_msg_accrights" >&6 - if test $ol_cv_msghdr_msg_accrights = "yes" ; then +echo "$as_me:$LINENO: result: $ac_cv_member_struct_msghdr_msg_accrights" >&5 +echo "${ECHO_T}$ac_cv_member_struct_msghdr_msg_accrights" >&6 + + if test $ac_cv_member_struct_msghdr_msg_accrights = "yes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_MSGHDR_MSG_ACCRIGHTS 1 _ACEOF - fi + fi LIBSRCS="$LIBSRCS getpeereid.c" fi -- 2.39.5