propellor spin
This commit is contained in:
parent
782e4f7f4b
commit
1f573876b7
|
@ -6,6 +6,7 @@
|
||||||
module Propellor.SimpleSh where
|
module Propellor.SimpleSh where
|
||||||
|
|
||||||
import Network.Socket
|
import Network.Socket
|
||||||
|
import Control.Concurrent
|
||||||
import Control.Concurrent.Chan
|
import Control.Concurrent.Chan
|
||||||
import Control.Concurrent.Async
|
import Control.Concurrent.Async
|
||||||
import System.Process (std_in, std_out, std_err)
|
import System.Process (std_in, std_out, std_err)
|
||||||
|
@ -31,6 +32,7 @@ simpleSh namedpipe = do
|
||||||
listen s 2
|
listen s 2
|
||||||
forever $ do
|
forever $ do
|
||||||
(client, _addr) <- accept s
|
(client, _addr) <- accept s
|
||||||
|
forkIO $ do
|
||||||
h <- socketToHandle client ReadWriteMode
|
h <- socketToHandle client ReadWriteMode
|
||||||
maybe noop (run h) . readish =<< hGetLine h
|
maybe noop (run h) . readish =<< hGetLine h
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in New Issue