summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Glondu <steph@glondu.net>2019-10-11 14:28:23 +0200
committerDamien Doligez <damien.doligez@inria.fr>2019-10-11 14:28:23 +0200
commit0dace4321658fb16f1ebbdadbae56b549ca90198 (patch)
tree82d30c3801a7ef56770ab51aa3e7d9440701e069
parent8b6e1e3c00c2caeb0f211056aa7cc2929b3f32ca (diff)
downloadocaml-0dace4321658fb16f1ebbdadbae56b549ca90198.tar.gz
Check for definition of AT_SECURE before using it (#8842)
Check for definition of AT_SECURE before using it This fixes compilation on kfreebsd.
-rw-r--r--Changes3
-rw-r--r--otherlibs/unix/envir.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/Changes b/Changes
index 1d7ea121a0..97a5707ea6 100644
--- a/Changes
+++ b/Changes
@@ -33,6 +33,9 @@ OCaml 4.08.1 (5 August 2019)
- #8843, #8841: fix use of off_t on 32-bit systems.
(Stephen Dolan, report by Richard Jones, review by Xavier Leroy)
+- #8842: check for definition of AT_SECURE before using it
+ (Stéphane Glondu, review by David Allsopp)
+
OCaml 4.08.0 (13 June 2019)
---------------------------
diff --git a/otherlibs/unix/envir.c b/otherlibs/unix/envir.c
index 3ad4b9caa0..bdc41939bc 100644
--- a/otherlibs/unix/envir.c
+++ b/otherlibs/unix/envir.c
@@ -39,7 +39,7 @@ CAMLprim value unix_environment_unsafe(value unit)
static char **secure_environ(void)
{
-#ifdef HAS_GETAUXVAL
+#if defined(HAS_GETAUXVAL) && defined(AT_SECURE)
if (!getauxval(AT_SECURE))
return environ;
else