From 7a8e47d1781ac6be152c9ea6a7338c7a19778a67 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Dec 2013 14:10:49 -0400 Subject: [PATCH] allow building on windows --- Assistant/WebApp/Control.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assistant/WebApp/Control.hs b/Assistant/WebApp/Control.hs index a9fcca22e2..8c28ff3a7c 100644 --- a/Assistant/WebApp/Control.hs +++ b/Assistant/WebApp/Control.hs @@ -18,7 +18,9 @@ import Utility.LogFile import Utility.NotificationBroadcaster import Control.Concurrent +#ifndef mingw32_HOST_OS import System.Posix (getProcessID, signalProcess, sigTERM) +#endif import qualified Data.Map as M import qualified Data.Text as T @@ -44,11 +46,15 @@ getShutdownConfirmedR = do liftAssistant $ do modifyDaemonStatus_ $ \status -> status { globalRedirUrl = Just url } liftIO . sendNotification . globalRedirNotifier =<< getDaemonStatus +#ifndef mingw32_HOST_OS {- Wait 2 seconds before shutting down, to give the web - page time to load in the browser. -} void $ liftIO $ forkIO $ do threadDelay 2000000 signalProcess sigTERM =<< getProcessID +#else + liftIO exitSuccess +#endif redirect NotRunningR {- Use a custom page to avoid putting long polling elements on it that will