diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-01-09 13:11:56 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-01-09 13:11:56 -0400 |
commit | 425bc1107aebdb701cdcee44da731dd918cd470d (patch) | |
tree | 25bcacb37277b70aa7bd0caaf0fe7c3edc665653 /Utility/Daemon.hs | |
parent | 20c7644a4d85434cf49840ea92fca0c723710c72 (diff) |
revert parentDir change
Reverts 2bba5bc22d049272d3328bfa6c452d3e2e50e86c
Unfortunately, this caused breakage on Windows, and possibly elsewhere,
because parentDir and takeDirectory do not behave the same when there is a
trailing directory separator.
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 961b098dc..d1f539e98 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 (takeDirectory pidfile) + createDirectoryIfMissing True (parentDir 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 (takeDirectory pidfile)) + (filter iswinlockfile <$> dirContents (parentDir pidfile)) iswinlockfile f = suffix `isSuffixOf` f && prefix `isPrefixOf` f #endif |