From 0636846848ce3a68c2f66cd798bf37d9afcf0877 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 4 Apr 2014 18:34:03 -0400 Subject: propellor spin --- Propellor/CmdLine.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs index 560e774d..5ea982c3 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!" -- cgit v1.2.3