diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-04 18:34:03 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-04 18:34:03 -0400 |
| commit | 0636846848ce3a68c2f66cd798bf37d9afcf0877 (patch) | |
| tree | c13983ea69ef49b91a0d84b6733ece1a17b1f097 /Propellor/CmdLine.hs | |
| parent | 6f9b3b2d8a39b98232ed728817019e9237b03c24 (diff) | |
propellor spin
Diffstat (limited to 'Propellor/CmdLine.hs')
| -rw-r--r-- | Propellor/CmdLine.hs | 4 |
1 files 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!" |
