From aef1d7e76d8c1fece1248f84b8e7094a57e006fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 4 Dec 2013 15:37:53 -0400 Subject: [PATCH] stuf on Windows --- Assistant/Restart.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assistant/Restart.hs b/Assistant/Restart.hs index 65d913712f..64e897bc3a 100644 --- a/Assistant/Restart.hs +++ b/Assistant/Restart.hs @@ -5,6 +5,8 @@ - Licensed under the GNU AGPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Assistant.Restart where import Assistant.Common @@ -21,8 +23,10 @@ import qualified Annex import qualified Git import Control.Concurrent -import System.Posix (getProcessID, signalProcess, sigTERM) import System.Process (cwd) +#ifndef mingw32_HOST_OS +import System.Posix (getProcessID, signalProcess, sigTERM) +#endif {- Before the assistant can be restarted, have to remove our - gitAnnexUrlFile and our gitAnnexPidFile. Pausing the watcher is also @@ -41,11 +45,15 @@ prepRestart = do - Wait for browser to update before terminating this process. -} postRestart :: URLString -> Assistant () postRestart url = do +#ifndef mingw32_HOST_OS modifyDaemonStatus_ $ \status -> status { globalRedirUrl = Just url } liftIO . sendNotification . globalRedirNotifier =<< getDaemonStatus void $ liftIO $ forkIO $ do threadDelaySeconds (Seconds 120) signalProcess sigTERM =<< getProcessID +#else + error "TODO windows postRestart" +#endif runRestart :: Assistant URLString runRestart = liftIO . newAssistantUrl