summaryrefslogtreecommitdiff
path: root/src/Propellor/Engine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-23 14:41:09 -0400
committerJoey Hess2014-11-23 14:41:09 -0400
commitac41f8b07b45b1855b1c10665757691a56b08353 (patch)
treed446f81a4068ca594abd881c2b055ad2f8662a12 /src/Propellor/Engine.hs
parent1b34f23414b574105ddfdf36fbeb86aa115a0e2e (diff)
parent3c952a0de9d228eafe6e208007be7d2e018d68b8 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Engine.hs')
-rw-r--r--src/Propellor/Engine.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs
index b551ca05..0b65fb7e 100644
--- a/src/Propellor/Engine.hs
+++ b/src/Propellor/Engine.hs
@@ -11,6 +11,8 @@ import "mtl" Control.Monad.Reader
import Control.Exception (bracket)
import System.PosixCompat
import System.Posix.IO
+import System.FilePath
+import System.Directory
import Propellor.Types
import Propellor.Message
@@ -60,6 +62,7 @@ onlyProcess :: FilePath -> IO a -> IO a
onlyProcess lockfile a = bracket lock unlock (const a)
where
lock = do
+ createDirectoryIfMissing True (takeDirectory lockfile)
l <- createFile lockfile stdFileMode
setLock l (WriteLock, AbsoluteSeek, 0, 0)
`catchIO` const alreadyrunning