summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2015-11-01 13:37:49 -0400
committerJoey Hess2015-11-01 13:37:49 -0400
commit4d63a9f0ad327cba305e239e51d02e5e33213eda (patch)
tree71622cb0261977dd02864bd14996717adb55c99d /src/Propellor/PrivData.hs
parent9c4ee2a6d299a24ff83cbb4cd04a2a402bccb78d (diff)
run editor processes in foreground
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index e59f42c3..6b77f782 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -54,6 +54,8 @@ import Utility.FileMode
import Utility.Env
import Utility.Table
import Utility.FileSystemEncoding
+import Utility.ConcurrentOutput
+import Utility.Process
-- | Allows a Property to access the value of a specific PrivDataField,
-- for use in a specific Context or HostContext.
@@ -192,7 +194,8 @@ editPrivData field context = do
hClose th
maybe noop (\p -> writeFileProtected' f (`L.hPut` privDataByteString p)) v
editor <- getEnvDefault "EDITOR" "vi"
- unlessM (boolSystem editor [File f]) $
+ (_, _, _, p) <- createProcessForeground $ proc editor [f]
+ unlessM (checkSuccessProcess p) $
error "Editor failed; aborting."
PrivData <$> readFile f
setPrivDataTo field context v'