Windows: Fix locking issue that prevented the webapp starting (since 5.20140707).

Reversion introduced in 9fb8038166.
The locking code was wrong; the webapp re-ran itself, saw pid was locked,
and so didn't start!
This commit is contained in:
Joey Hess 2014-07-14 15:44:44 -04:00
parent 2416ed18c4
commit 339a3b8ab0
3 changed files with 16 additions and 2 deletions

View file

@ -102,7 +102,6 @@ startDaemon assistant foreground startdelay cannotrun listenhost startbrowser =
createAnnexDirectory (parentDir logfile)
ifM (liftIO $ isNothing <$> getEnv flag)
( liftIO $ withFile devNull WriteMode $ \nullh -> do
Utility.Daemon.lockPidFile pidfile
when (not foreground) $
debugM desc $ "logging to " ++ logfile
loghandle <- openLog logfile
@ -116,7 +115,7 @@ startDaemon assistant foreground startdelay cannotrun listenhost startbrowser =
, std_err = UseHandle loghandle
}
exitWith =<< waitForProcess pid
, start id $ do
, start (Utility.Daemon.foreground (Just pidfile)) $
case startbrowser of
Nothing -> Nothing
Just a -> Just $ a Nothing Nothing