1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

Use vfork

This commit is contained in:
Eelco Dolstra 2014-12-10 16:35:42 +01:00
parent b5ed5b6e66
commit 0e8fc118b3
3 changed files with 39 additions and 11 deletions

View file

@ -799,6 +799,11 @@ static void daemonLoop(char * * argv)
% (peer.uidKnown ? user : "<unknown>"));
/* Fork a child to handle the connection. */
ProcessOptions options;
options.errorPrefix = "unexpected Nix daemon error: ";
options.dieWithParent = false;
options.runExitHandlers = true;
options.allowVfork = false;
startProcess([&]() {
fdSocket.close();
@ -821,7 +826,7 @@ static void daemonLoop(char * * argv)
processConnection(trusted);
exit(0);
}, false, "unexpected Nix daemon error: ", true);
}, options);
} catch (Interrupted & e) {
throw;