diff --git a/lix/nix/daemon.cc b/lix/nix/daemon.cc index a4a223952..75818d719 100644 --- a/lix/nix/daemon.cc +++ b/lix/nix/daemon.cc @@ -286,8 +286,7 @@ static std::pair authPeer(const PeerInfo & peer) * the client. Otherwise, decide based on the authentication settings * and user credentials (from the unix domain socket). */ -static void daemonLoop(AsyncIoRoot & aio, std::optional forceTrustClientOpt); -static void daemonLoopImpl(std::optional forceTrustClientOpt) +static void daemonLoop(AsyncIoRoot & aio, std::optional forceTrustClientOpt) { if (chdir("/") == -1) throw SysError("cannot change current directory"); @@ -386,20 +385,6 @@ static void daemonLoopImpl(std::optional forceTrustClientOpt) } } } -static void daemonLoop(AsyncIoRoot & aio, std::optional forceTrustClientOpt) -{ - // we can't reuse the external async io root since it'd be shared with the - // children we will create, potentially trashing state, but the *previous* - // root is still alive as far as kj is concerned. we cannot recreate it in - // the child easily because darwin closes kqueues after fork, and since kj - // asserts after the kqueue close returns EBADF we'll die. the least awful - // way around this is to run the daemon loop in its own thread, without an - // async io root, and thus not have any shared state after we have forked. - std::async(std::launch::async, [&] { - ReceiveInterrupts ri; - return daemonLoopImpl(forceTrustClientOpt); - }).get(); -} static void daemonInstance(AsyncIoRoot & aio, std::optional forceTrustClientOpt) {