You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/04 18:32:25 UTC

svn commit: r800865 - /commons/sandbox/runtime/trunk/src/main/native/configure

Author: mturk
Date: Tue Aug  4 16:32:25 2009
New Revision: 800865

URL: http://svn.apache.org/viewvc?rev=800865&view=rev
Log:
Use the same function for CLOEXEC flags

Modified:
    commons/sandbox/runtime/trunk/src/main/native/configure

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=800865&r1=800864&r2=800865&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Tue Aug  4 16:32:25 2009
@@ -728,6 +728,33 @@
     echo $rc
 }
 
+have_flag_defined()
+{
+    printf "Checking for %-32s" "O_CLOEXEC flag" 1>&2
+    cat > $test.c << EOF
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <fcntl.h>
+int main() {return (int)($1);}
+EOF
+    rc=0
+    co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+    if [ ".$co" = . ]; then
+        rc=1
+    else
+        test -x $test$exe && rc=1
+    fi
+    rm -rf $test.* $test *.pdb >/dev/null 2>&1 || true
+    if [ $rc = 1 ]; then
+        echo ok 1>&2
+    else
+        echo "not found" 1>&2
+    fi
+    echo $rc
+}
+
 check_sizeof()
 {
     printf "Checking for sizeof %-25s" "$1" 1>&2
@@ -908,8 +935,8 @@
 #define HAVE_DUP3             `have_function dup3`
 #define HAVE_EPOLL_CREATE1    `have_function epoll_create1`
 #define HAVE_SIGSETJMP        `have_function sigsetjmp`
-#define HAVE_SOCK_CLOEXEC     `have_sock_cloexec`
-#define HAVE_FILE_CLOEXEC     `have_file_cloexec`
+#define HAVE_SOCK_CLOEXEC     `have_flag_defined SOCK_CLOEXEC`
+#define HAVE_FILE_CLOEXEC     `have_flag_defined O_CLOEXEC`
 #define HAVE_OFF64_T          $have_off64t
 #define HAVE_LONG_LONG        $have_long_long
 #define HAVE_LONG_DOUBLE      $have_long_double