Skip to content

Commit

Permalink
Shim rename of unix_cloexec_default
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jun 18, 2022
1 parent cd92ce4 commit 56fba76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/unix/unix_c/unix_open_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <caml/alloc.h>
#include <caml/mlvalues.h>
#include <caml/unixsupport.h>
#include <caml/version.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 56fba76

Please sign in to comment.