diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs index 560e774..5ea982c 100644 --- a/Propellor/CmdLine.hs +++ b/Propellor/CmdLine.hs @@ -85,9 +85,9 @@ onlyProcess :: IO a -> IO a onlyProcess a = bracket lock unlock (const a) where lock = do - l <- openFd lockfile ReadWrite Nothing defaultFileFlags + l <- createFile lockfile stdFileMode setLock l (WriteLock, AbsoluteSeek, 0, 0) - `catchIO` (const alreadyrunning) + `catchIO` const alreadyrunning return l unlock = closeFd alreadyrunning = error "Propellor is already running on this host!"