From 56fba76c92623d764305f49dfcd0a82c69a30e69 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 18 Jun 2022 09:48:04 +0100 Subject: [PATCH] Shim rename of unix_cloexec_default --- src/unix/unix_c/unix_open_job.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/unix/unix_c/unix_open_job.c b/src/unix/unix_c/unix_open_job.c index 8a913ba19..a77ad1cab 100644 --- a/src/unix/unix_c/unix_open_job.c +++ b/src/unix/unix_c/unix_open_job.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,10 @@ #define O_RSYNC 0 #endif +#if OCAML_VERSION_MAJOR < 5 +#define caml_unix_cloexec_default unix_cloexec_default +#endif + static int open_flag_table[] = { O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK, O_APPEND, O_CREAT, O_TRUNC, O_EXCL, O_NOCTTY, O_DSYNC, O_SYNC, O_RSYNC, 0, /* O_SHARE_DELETE, @@ -64,7 +69,7 @@ static void worker_open(struct job_open *job) else if (job->fd & KEEPEXEC) cloexec = 0; else - cloexec = unix_cloexec_default; + cloexec = caml_unix_cloexec_default; #if defined(O_CLOEXEC) if (cloexec) job->flags |= O_CLOEXEC;