summaryrefslogtreecommitdiff
path: root/Propellor/SimpleSh.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-04-08 02:06:37 -0400
committerJoey Hess <joey@kitenet.net>2014-04-08 02:07:11 -0400
commit634cf61c7989f5d20bccd822e2fd568ccbdef947 (patch)
tree29ff196aea04f736dcc4f3b4e3929bdefe754c71 /Propellor/SimpleSh.hs
parent3068fdbe78cb86a9272b1ce5200653f5331fb173 (diff)
parent7ba62a28b51dc5826c70d3be0ab41825e31d28ac (diff)
Merge branch 'joeyconfig'
Conflicts: Propellor/Property/Docker.hs
Diffstat (limited to 'Propellor/SimpleSh.hs')
-rw-r--r--Propellor/SimpleSh.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Propellor/SimpleSh.hs b/Propellor/SimpleSh.hs
index 0999be9a..99a6fc24 100644
--- a/Propellor/SimpleSh.hs
+++ b/Propellor/SimpleSh.hs
@@ -9,7 +9,6 @@ import Network.Socket
import Control.Concurrent.Chan
import Control.Concurrent.Async
import System.Process (std_in, std_out, std_err)
-import System.Exit
import Propellor
import Utility.FileMode
@@ -18,7 +17,7 @@ import Utility.ThreadScheduler
data Cmd = Cmd String [String]
deriving (Read, Show)
-data Resp = StdoutLine String | StderrLine String | Done ExitCode
+data Resp = StdoutLine String | StderrLine String | Done
deriving (Read, Show)
simpleSh :: FilePath -> IO ()
@@ -49,7 +48,7 @@ simpleSh namedpipe = do
v <- readChan chan
hPutStrLn h (show v)
case v of
- Done _ -> noop
+ Done -> noop
_ -> runwriter
writer <- async runwriter
@@ -58,8 +57,10 @@ simpleSh namedpipe = do
void $ concurrently
(mkreader StdoutLine outh)
(mkreader StderrLine errh)
+
+ void $ tryIO $ waitForProcess pid
- writeChan chan . Done =<< waitForProcess pid
+ writeChan chan Done
wait writer