diff options
Diffstat (limited to 'Utility/Daemon.hs')
-rw-r--r-- | Utility/Daemon.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Utility/Daemon.hs b/Utility/Daemon.hs index d1f539e98..961b098dc 100644 --- a/Utility/Daemon.hs +++ b/Utility/Daemon.hs @@ -83,7 +83,7 @@ foreground pidfile a = do - Fails if the pid file is already locked by another process. -} lockPidFile :: FilePath -> IO () lockPidFile pidfile = do - createDirectoryIfMissing True (parentDir pidfile) + createDirectoryIfMissing True (takeDirectory pidfile) #ifndef mingw32_HOST_OS fd <- openFd pidfile ReadWrite (Just stdFileMode) defaultFileFlags locked <- catchMaybeIO $ setLock fd (WriteLock, AbsoluteSeek, 0, 0) @@ -176,6 +176,6 @@ winLockFile pid pidfile = do prefix = pidfile ++ "." suffix = ".lck" cleanstale = mapM_ (void . tryIO . removeFile) =<< - (filter iswinlockfile <$> dirContents (parentDir pidfile)) + (filter iswinlockfile <$> dirContents (takeDirectory pidfile)) iswinlockfile f = suffix `isSuffixOf` f && prefix `isPrefixOf` f #endif |