fix build on windows
This commit is contained in:
parent
1be38362aa
commit
bce8865824
1 changed files with 3 additions and 3 deletions
|
@ -176,14 +176,14 @@ stopDaemon pidfile = go =<< checkDaemon pidfile
|
||||||
- when eg, restarting the daemon.
|
- when eg, restarting the daemon.
|
||||||
-}
|
-}
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
winLockFile :: PID -> FilePath -> IO FilePath
|
winLockFile :: PID -> FilePath -> IO RawFilePath
|
||||||
winLockFile pid pidfile = do
|
winLockFile pid pidfile = do
|
||||||
cleanstale
|
cleanstale
|
||||||
return $ prefix ++ show pid ++ suffix
|
return $ toRawFilePath $ prefix ++ show pid ++ suffix
|
||||||
where
|
where
|
||||||
prefix = pidfile ++ "."
|
prefix = pidfile ++ "."
|
||||||
suffix = ".lck"
|
suffix = ".lck"
|
||||||
cleanstale = mapM_ (void . tryIO . removeFile) =<<
|
cleanstale = mapM_ (void . tryIO . removeFile) =<<
|
||||||
(filter iswinlockfile <$> dirContents (parentDir pidfile))
|
(filter iswinlockfile <$> dirContents (fromRawFilePath (parentDir (toRawFilePath pidfile))))
|
||||||
iswinlockfile f = suffix `isSuffixOf` f && prefix `isPrefixOf` f
|
iswinlockfile f = suffix `isSuffixOf` f && prefix `isPrefixOf` f
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue