about summary refs log tree commit diff
path: root/src/libstore/remote-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-13T18·46-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-13T18·46-0400
commit8fbe96cb3154d5db11b15728ad037bed28f08aa9 (patch)
treea4b71af037e4e46fc3952cb687ed0132905b1144 /src/libstore/remote-store.cc
parente6e495649cc1f324cd0a66cfaf3c4bdf21522e63 (diff)
RemoteStore::connectToDaemon(): Set close-on-exec flag
This ensures that "nix-build --run-env" doesn't keep a connection to
the worker open, preventing it from exiting.
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r--src/libstore/remote-store.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index d3c05f0df4b1..11712b48774b 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -141,6 +141,7 @@ void RemoteStore::connectToDaemon()
     fdSocket = socket(PF_UNIX, SOCK_STREAM, 0);
     if (fdSocket == -1)
         throw SysError("cannot create Unix domain socket");
+    closeOnExec(fdSocket);
 
     string socketPath = settings.nixStateDir + DEFAULT_SOCKET_PATH;