aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-11-05 10:25:09 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-11-05 10:25:09 +0100
commit1b600ecd14049985dc1001d22d6495810ca418a0 (patch)
treeecfdc003ee0b26cf8df567e9ccaddf6655f60499
parent3770f5c94482a452744015ae6c0794b8382cc5a6 (diff)
Don't use SOCK_CLOEXEC on macOS
https://hydra.nixos.org/build/105428308
-rw-r--r--src/libutil/util.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index d29802bcd..34c1d96dc 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -1567,7 +1567,11 @@ std::unique_ptr<InterruptCallback> createInterruptCallback(std::function<void()>
AutoCloseFD createUnixDomainSocket(const Path & path, mode_t mode)
{
- AutoCloseFD fdSocket = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ AutoCloseFD fdSocket = socket(PF_UNIX, SOCK_STREAM
+ #ifdef SOCK_CLOEXEC
+ | SOCK_CLOEXEC
+ #endif
+ , 0);
if (!fdSocket)
throw SysError("cannot create Unix domain socket");