From ffe3e478657dc7126fca6329dfcedc49f4c726d9 Mon Sep 17 00:00:00 2001 From: Lars Volker Date: Wed, 10 May 2017 22:50:32 +0200 Subject: Only use O_CLOEXEC on platforms that support it Change a9fca58 made use of the O_CLOEXEC flag, which is not supported on older Linux kernels. This change makes the use contingent on kernel support. Testing: I manually compiled breakpad on CentOS 5.8 running kernel 2.6.18-308.8.2.el5.centos.plusxen. Bug: 730 Change-Id: I21dff928cfba3c156a56708913f65a0c7b5396a6 Reviewed-on: https://chromium-review.googlesource.com/498528 Reviewed-by: Mike Frysinger --- configure | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'configure') diff --git a/configure b/configure index dcfd3c76..5e94512c 100755 --- a/configure +++ b/configure @@ -7455,6 +7455,46 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC defined in fcntl.h" >&5 +$as_echo_n "checking for O_CLOEXEC defined in fcntl.h... " >&6; } +if ${ac_cv_defined_O_CLOEXEC_fcntl_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + #ifdef O_CLOEXEC + int ok; + #else + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_defined_O_CLOEXEC_fcntl_h=yes +else + ac_cv_defined_O_CLOEXEC_fcntl_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined_O_CLOEXEC_fcntl_h" >&5 +$as_echo "$ac_cv_defined_O_CLOEXEC_fcntl_h" >&6; } +if test $ac_cv_defined_O_CLOEXEC_fcntl_h != "no"; then : + +else + +$as_echo "#define O_CLOEXEC 0" >>confdefs.h + +fi + # Only build Linux client libs when compiling for Linux case $host in *-*-linux* | *-android* ) -- cgit v1.2.1