diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-11-08 14:50:21 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-11-08 14:50:21 -0400 |
| commit | d7e140aeae8a8ea47976ca1f3e29c4d0b00eacee (patch) | |
| tree | 31aa4bbf775879dddb307f9d1c99ac84287ca909 /src/Propellor/PrivData.hs | |
| parent | f85b7d1bdc9019fd63c5037094f514a7c7ace8d2 (diff) | |
| parent | d50aa85052b1f35021072ea95bc51b5c46c797b0 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/PrivData.hs')
| -rw-r--r-- | src/Propellor/PrivData.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs index e59f42c3..a1e34abc 100644 --- a/src/Propellor/PrivData.hs +++ b/src/Propellor/PrivData.hs @@ -36,6 +36,8 @@ import "mtl" Control.Monad.Reader import qualified Data.Map as M import qualified Data.Set as S import qualified Data.ByteString.Lazy as L +import System.Console.Concurrent +import System.Console.Concurrent.Internal (ConcurrentProcessHandle(..)) import Propellor.Types import Propellor.Types.PrivData @@ -54,6 +56,7 @@ import Utility.FileMode import Utility.Env import Utility.Table import Utility.FileSystemEncoding +import Utility.Process -- | Allows a Property to access the value of a specific PrivDataField, -- for use in a specific Context or HostContext. @@ -192,7 +195,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]) $ + (_, _, _, ConcurrentProcessHandle p) <- createProcessForeground $ proc editor [f] + unlessM (checkSuccessProcess p) $ error "Editor failed; aborting." PrivData <$> readFile f setPrivDataTo field context v' |
