diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-06-09 16:15:58 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-06-09 16:37:08 +0200 |
commit | 202683a4fc148dc228de226e9980a3f27754b854 (patch) | |
tree | dd75cf8f873a913ac3baf222eb93981622407d5f /src/libstore/remote-store.cc | |
parent | 9bdd949cfdc9e49f1e01460a2a73215cac3ec904 (diff) |
Use O_CLOEXEC in most places
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 3654ffbff..50ad409a9 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -61,7 +61,11 @@ ref<RemoteStore::Connection> RemoteStore::openConnection() auto conn = make_ref<Connection>(); /* Connect to a daemon that does the privileged work for us. */ - conn->fd = socket(PF_UNIX, SOCK_STREAM, 0); + conn->fd = socket(PF_UNIX, SOCK_STREAM + #ifdef SOCK_CLOEXEC + | SOCK_CLOEXEC + #endif + , 0); if (conn->fd == -1) throw SysError("cannot create Unix domain socket"); closeOnExec(conn->fd); |