mirror of
https://github.com/NixOS/nix.git
synced 2025-11-17 07:52:43 +01:00
Use O_CLOEXEC in most places
This commit is contained in:
parent
9bdd949cfd
commit
202683a4fc
9 changed files with 23 additions and 19 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue