summaryrefslogtreecommitdiff
path: root/LocationLog.hs
diff options
context:
space:
mode:
Diffstat (limited to 'LocationLog.hs')
-rw-r--r--LocationLog.hs8
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