From 29f58f46e77af161b34600080ad1aa9301aeb5be Mon Sep 17 00:00:00 2001 From: sorki Date: Sun, 10 Dec 2023 18:53:47 +0100 Subject: [PATCH] remote: fix pretty TODO failing to parse on old GHC --- hnix-store-remote/src/System/Nix/Store/Remote.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hnix-store-remote/src/System/Nix/Store/Remote.hs b/hnix-store-remote/src/System/Nix/Store/Remote.hs index 896e2d8..53c3737 100644 --- a/hnix-store-remote/src/System/Nix/Store/Remote.hs +++ b/hnix-store-remote/src/System/Nix/Store/Remote.hs @@ -161,11 +161,10 @@ runDaemonSocket workerHelper postGreet sockFamily sockAddr k = Network.Socket.Stream Network.Socket.defaultProtocol ) - (\lsock -> liftIO $ Network.Socket.close lsock) -- *> System.Directory.removeFile f) + (\lsock -> liftIO $ Network.Socket.close lsock) $ \lsock -> do - -- ^^^^^^^^^^^^ - -- TODO: this: -------------------------------------------------------//////////// - -- should really be + -- TODO: the: (\lsock -> liftIO $ Network.Socket.close lsock *> System.Directory.removeFile f) + -- branch should really be (and even removeFile is currently omitted) -- a file lock followed by unlink *before* bind rather than after close. If -- the program crashes (or loses power or something) then a stale unix -- socket will stick around and prevent the daemon from starting. using a