From 4f59f9439687cccfb7aac6aca62dbe97038179bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Feb 2014 14:00:15 -0400 Subject: windows: Fix process termination code. The ctrl-c hack used before didn't actually seem to work. No haskell libraries expose TerminateProcess. I tried just calling it via FFI, but got segfaults, probably to do with the wacky process handle not being managed correctly. Moving it all into one C function worked. This was hell. The EvilLinker hack was just final icing on the cake. We all know what the cake was made of. --- Assistant.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Assistant.hs') diff --git a/Assistant.hs b/Assistant.hs index 800a3ef78..c66a1b73b 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -93,7 +93,8 @@ startDaemon assistant foreground startdelay cannotrun listenhost startbrowser = start (Utility.Daemon.daemonize logfd (Just pidfile) False) Nothing #else -- Windows is always foreground, and has no log file. - start id $ + liftIO $ Utility.Daemon.lockPidFile pidfile + start id $ do case startbrowser of Nothing -> Nothing Just a -> Just $ a Nothing Nothing -- cgit v1.2.3