From a53d6ec4fcc7d0fe0a0fa2bd36b85ad390555283 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 14 Feb 2004 00:31:35 +0000 Subject: [PATCH] * aclocal.m4 (TRY_PEER_INT): Deleted. (KRB5_GETPEERNAME_ARGS): Map the getpeername arg types to the corresponding getsockname arg types. (KRB5_GETSOCKNAME_ARGS): If nothing matches, assume struct sockaddr and socklen_t. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16080 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 8 ++++++++ src/aclocal.m4 | 49 +++++++++++-------------------------------------- 2 files changed, 19 insertions(+), 38 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 531ba7e65..e3119eeba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-02-13 Ken Raeburn + + * aclocal.m4 (TRY_PEER_INT): Deleted. + (KRB5_GETPEERNAME_ARGS): Map the getpeername arg types to the + corresponding getsockname arg types. + (KRB5_GETSOCKNAME_ARGS): If nothing matches, assume struct + sockaddr and socklen_t. + 2004-02-12 Tom Yu * aclocal.m4 (KRB5_AC_PRIOCNTL_HACK): Set PRIOCNTL_HACK=1 on diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 05e0fb8b5..341876153 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1280,42 +1280,9 @@ dnl dnl ============================================================= dnl Internal function for testing for getpeername prototype dnl -AC_DEFUN([TRY_PEER_INT],[ -krb5_lib_var=`echo "$1 $2" | sed 'y% ./+-*%___p_p%'` -AC_MSG_CHECKING([if getpeername() takes arguments $1 and $2]) -AC_CACHE_VAL(krb5_cv_getpeername_proto$krb5_lib_var, -[ -AC_TRY_COMPILE([#include -#include -extern int getpeername(int, $1, $2); -],,eval "krb5_cv_getpeername_proto$krb5_lib_var=yes", - eval "krb5_cv_getpeername_proto$krb5_lib_var=no")]) -if eval "test \"`echo '$krb5_cv_getpeername_proto'$krb5_lib_var`\" = yes"; then - AC_MSG_RESULT(yes) - peer_set=yes - res1=`echo "$1" | tr -d '*' | sed -e 's/ *$//'` - res2=`echo "$2" | tr -d '*' | sed -e 's/ *$//'` - AC_DEFINE_UNQUOTED([GETPEERNAME_ARG2_TYPE],$res1) - AC_DEFINE_UNQUOTED([GETPEERNAME_ARG3_TYPE],$res2) -else - AC_MSG_RESULT(no) -fi -]) -dnl -dnl Determines the types of the second and third arguments to getpeername() -dnl Note: It is possible that noe of the combinations will work and the -dnl code must deal AC_DEFUN([KRB5_GETPEERNAME_ARGS],[ -peer_set=no -for peer_arg1 in "struct sockaddr *" "void *" -do - for peer_arg2 in "size_t *" "int *" "socklen_t *" - do - if test $peer_set = no; then - TRY_PEER_INT($peer_arg1, $peer_arg2) - fi - done -done +AC_DEFINE([GETPEERNAME_ARG2_TYPE],GETSOCKNAME_ARG2_TYPE) +AC_DEFINE([GETPEERNAME_ARG3_TYPE],GETSOCKNAME_ARG3_TYPE) ]) dnl dnl ============================================================= @@ -1343,9 +1310,8 @@ else fi ]) dnl -dnl Determines the types of the second and third arguments to getsockname() -dnl Note: It is possible that noe of the combinations will work and the -dnl code must deal +dnl Determines the types of the second and third arguments to getsockname(). +dnl AC_DEFUN([KRB5_GETSOCKNAME_ARGS],[ sock_set=no for sock_arg1 in "struct sockaddr *" "void *" @@ -1357,6 +1323,13 @@ do fi done done +if test "$sock_set" = no; then + AC_MSG_NOTICE(assuming struct sockaddr and socklen_t for getsockname args) + res1=`echo "struct sockaddr *" | tr -d '*' | sed -e 's/ *$//'` + AC_DEFINE_UNQUOTED([GETSOCKNAME_ARG2_TYPE],$res1) + res2=`echo "socklen_t *" | tr -d '*' | sed -e 's/ *$//'` + AC_DEFINE_UNQUOTED([GETSOCKNAME_ARG3_TYPE],$res2) +fi ]) dnl dnl -- 2.26.2