aboutsummaryrefslogtreecommitdiff
path: root/Assistant.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-25 14:09:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-25 14:48:50 -0400
commitf55d91cc91eec2debf4bb013ff2f5201ea1474ea (patch)
tree8b8701608fef4f49622018f26706ebd46bfae943 /Assistant.hs
parentc3aaa702c8fe4424dacfddfc255fca8d6149ad06 (diff)
fix all remaining -Wall warnings on Windows
Diffstat (limited to 'Assistant.hs')
-rw-r--r--Assistant.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/Assistant.hs b/Assistant.hs
index c66a1b73b..db6fc850c 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -49,11 +49,13 @@ import Assistant.Threads.XMPPPusher
import Assistant.Types.UrlRenderer
#endif
import qualified Utility.Daemon
-import Utility.LogFile
import Utility.ThreadScheduler
import Utility.HumanTime
-import Annex.Perms
import qualified Build.SysConfig as SysConfig
+#ifndef mingw32_HOST_OS
+import Utility.LogFile
+import Annex.Perms
+#endif
import System.Log.Logger
import Network.Socket (HostName)
@@ -70,8 +72,8 @@ startDaemon :: Bool -> Bool -> Maybe Duration -> Maybe String -> Maybe HostName
startDaemon assistant foreground startdelay cannotrun listenhost startbrowser = do
Annex.changeState $ \s -> s { Annex.daemon = True }
pidfile <- fromRepo gitAnnexPidFile
- logfile <- fromRepo gitAnnexLogFile
#ifndef mingw32_HOST_OS
+ logfile <- fromRepo gitAnnexLogFile
createAnnexDirectory (parentDir logfile)
logfd <- liftIO $ openLog logfile
if foreground
@@ -93,11 +95,12 @@ 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.
- liftIO $ Utility.Daemon.lockPidFile pidfile
- start id $ do
- case startbrowser of
- Nothing -> Nothing
- Just a -> Just $ a Nothing Nothing
+ when (foreground || not foreground) $ do
+ liftIO $ Utility.Daemon.lockPidFile pidfile
+ start id $ do
+ case startbrowser of
+ Nothing -> Nothing
+ Just a -> Just $ a Nothing Nothing
#endif
where
desc