diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-28 12:35:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-28 12:35:51 -0400 |
commit | 04fe906ac6e611fd59ef44244a01e8fe61abec6f (patch) | |
tree | cfcc6f6ca79bc55606135088d609237a8aacd1b2 /LocationLog.hs | |
parent | 4f9336bb60ca4dc08ca271605de71415c98ec3ff (diff) |
use safewritefile
Diffstat (limited to 'LocationLog.hs')
-rw-r--r-- | LocationLog.hs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/LocationLog.hs b/LocationLog.hs index 926939051..56953bc02 100644 --- a/LocationLog.hs +++ b/LocationLog.hs @@ -32,7 +32,6 @@ import Data.Time import System.Locale import qualified Data.Map as Map import System.Directory -import System.Posix.Process import Control.Monad (when) import qualified GitRepo as Git @@ -112,12 +111,7 @@ readLog file = do {- Writes a set of lines to a log file -} writeLog :: FilePath -> [LogLine] -> IO () -writeLog file ls = do - pid <- getProcessID - let tmpfile = file ++ ".tmp" ++ show pid - createDirectoryIfMissing True (parentDir file) - writeFile tmpfile $ unlines $ map show ls - renameFile tmpfile file +writeLog file ls = safeWriteFile file (unlines $ map show ls) {- Generates a new LogLine with the current date. -} logNow :: LogStatus -> UUID -> IO LogLine |