You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2004/06/04 15:15:53 UTC

cvs commit: apr/build apr_network.m4

jorton      2004/06/04 06:15:53

  Modified:    build    apr_network.m4
  Log:
  * build/apr_network.m4 (APR_CHECK_SCTP): Safer check for SCTP support
  and cleanup macro.
  
  PR: 28576
  Submitted by: Paul Querna <chip force-elite.com>, Joe Orton
  
  Revision  Changes    Path
  1.32      +11 -15    apr/build/apr_network.m4
  
  Index: apr_network.m4
  ===================================================================
  RCS file: /home/cvs/apr/build/apr_network.m4,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -d -w -u -r1.31 -r1.32
  --- apr_network.m4	20 May 2004 14:53:21 -0000	1.31
  +++ apr_network.m4	4 Jun 2004 13:15:53 -0000	1.32
  @@ -624,7 +624,7 @@
   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_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [
     AC_TRY_RUN( [
   #ifdef HAVE_SYS_TYPES_H
   #include <sys/types.h>
  @@ -635,21 +635,17 @@
   #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) {
  +    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