zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phunt <...@git.apache.org>
Subject [GitHub] zookeeper pull request #427: [ZOOKEEPER-2338] - set SOCK_CLOEXEC on socket i...
Date Fri, 19 Jan 2018 00:38:43 GMT
Github user phunt commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/427#discussion_r162510701
  
    --- Diff: src/c/configure.ac ---
    @@ -130,18 +130,66 @@ main()
      else
        exit(0);
     }
    -], AC_MSG_RESULT(yes) 
    -   ipv6=yes, 
    -   AC_MSG_RESULT(no) 
    -   ipv6=no, 
    -   AC_MSG_RESULT(no) 
    +], AC_MSG_RESULT(yes)
    +   ipv6=yes,
    +   AC_MSG_RESULT(no)
    +   ipv6=no,
    +   AC_MSG_RESULT(no)
        ipv6=no)
     
     if test x"$ipv6" = xyes; then
       USEIPV6="-DZOO_IPV6_ENABLED"
       AC_SUBST(USEIPV6)
     fi
     
    +# use SOCK_CLOEXEC if available and wanted
    +AC_ARG_WITH([sock_cloexec],
    +[AS_HELP_STRING([--with-sock-cloexec],[build with SOCK_CLOEXEC flag set on the connections])],
    +[],[with_sock_cloexec=no])
    +
    +AC_MSG_CHECKING([whether SOCK_CLOEXEC is available])
    +
    +AC_TRY_RUN([ /* is SOCK_CLOEXEC available ? */
    +#include <sys/types.h>
    +#include <sys/socket.h>
    +#include <stdlib.h>
    +main()
    +{
    +#ifdef SOCK_CLOEXEC
    +  exit(0);
    +#else
    +  exit(1);
    +#endif
    +}
    +], AC_MSG_RESULT(yes)
    +   has_sock_cloexec=yes,
    +   AC_MSG_RESULT(no)
    +   has_sock_cloexec=no,
    +   AC_MSG_RESULT(no)
    +   has_sock_cloexec=no)
    +
    +if test "x$with_sock_cloexec" != xno && test "x$has_sock_cloexec" = xno; then
    +  AC_MSG_WARN([cannot use SOCK_CLOEXEC -- SOCK_CLOEXEC undefined on this platform])
    +  with_sock_cloexec=no
    +fi
    +
    +if test "x$with_sock_cloexec" != xno; then
    +AC_MSG_NOTICE([building with SOCK_CLOEXEC])
    +else
    +AC_MSG_NOTICE([building without SOCK_CLOEXEC])
    +fi
    +
    +AS_IF([test x"$with_sock_cloexec" != xno], [AC_DEFINE([SOCK_CLOEXEC_ENABLED], [1], [Define
to 1, if SOCK_CLOEXEC is defined and wanted])])
    +AM_CONDITIONAL([SOCK_CLOEXEC_ENABLED],[test "x$with_sock_cloexec" != xno])
    +
    +# Determine which libraries we need to use clock_gettime
    --- End diff --
    
    @fr0stbyte I'd still like to get this committed - does my most recent comment make sense
or am I missing something?


---

Mime
View raw message