Skip to content

Commit eb94587

Browse files
committed
Shim rename of unix_cloexec_default
1 parent 9d4f2b5 commit eb94587

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/unix/unix_c/unix_open_job.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <caml/alloc.h>
1111
#include <caml/mlvalues.h>
1212
#include <caml/unixsupport.h>
13+
#include <caml/version.h>
1314
#include <sys/types.h>
1415
#include <sys/stat.h>
1516
#include <errno.h>
@@ -30,6 +31,10 @@
3031
#define O_RSYNC 0
3132
#endif
3233

34+
#if OCAML_VERSION_MAJOR < 5
35+
#define caml_unix_cloexec_default unix_cloexec_default
36+
#endif
37+
3338
static int open_flag_table[] = {
3439
O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK, O_APPEND, O_CREAT, O_TRUNC,
3540
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)
6469
else if (job->fd & KEEPEXEC)
6570
cloexec = 0;
6671
else
67-
cloexec = unix_cloexec_default;
72+
cloexec = caml_unix_cloexec_default;
6873

6974
#if defined(O_CLOEXEC)
7075
if (cloexec) job->flags |= O_CLOEXEC;

0 commit comments

Comments
 (0)