diff options
author | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-04 13:19:16 +0000 |
---|---|---|
committer | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-04 13:19:16 +0000 |
commit | 1c9f5ff2dc70f694eafb8fcfaabf2050190d7adc (patch) | |
tree | 113669b6e2194f7c2fa186c6304b6d26a10f6376 /build | |
parent | 6390ef3c11fb2a1347d830b5ece22dc4102b7b8c (diff) | |
download | libapr-1c9f5ff2dc70f694eafb8fcfaabf2050190d7adc.tar.gz |
As per HEAD:
* build/apr_network.m4 (APR_CHECK_SCTP): Safer check for SCTP support
and clean up macro.
PR: 28576
Submitted by: Paul Querna <chip force-elite.com>, Joe Orton
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65154 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r-- | build/apr_network.m4 | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 58ae115d4..bc6ae0e17 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -633,8 +633,8 @@ dnl dnl check for presence of SCTP protocol support dnl AC_DEFUN(APR_CHECK_SCTP,[ - AC_CACHE_CHECK(if SCTP protocol is supported, ac_cv_sctp,[ - AC_TRY_RUN( [ + AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [ + AC_TRY_RUN([ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -644,21 +644,17 @@ AC_DEFUN(APR_CHECK_SCTP,[ #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif +#include <stdlib.h> int main(void) { - int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); - if (s < 0) { - exit(1); - } + int s, opt = 1; + if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0) + exit(1); + if (setsockopt(s, IPPROTO_SCTP, SCTP_NODELAY, &opt, sizeof(int)) < 0) + exit(2); exit(0); -} -],[ - ac_cv_sctp="yes" -],[ - ac_cv_sctp="no" -],[ - ac_cv_sctp="yes" -])]) -if test "$ac_cv_sctp" = "yes"; then +}], [apr_cv_sctp=yes], [apr_cv_sctp=no], [apr_cv_sctp=no])]) + +if test "$apr_cv_sctp" = "yes"; then have_sctp=1 else have_sctp=0 |