diff options
-rw-r--r-- | Utility/Daemon.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Utility/Daemon.hs b/Utility/Daemon.hs index 3d2faed67..192340cef 100644 --- a/Utility/Daemon.hs +++ b/Utility/Daemon.hs @@ -44,7 +44,8 @@ daemonize logfd pidfile changedirectory a = do lockPidFile :: Bool -> IO () -> FilePath -> IO () lockPidFile write onfailure file = do - fd <- openFd file ReadWrite (Just stdFileMode) defaultFileFlags + fd <- openFd file ReadWrite (Just stdFileMode) + defaultFileFlags { trunc = write } locked <- catchMaybeIO $ setLock fd (locktype, AbsoluteSeek, 0, 0) case locked of Nothing -> onfailure |