get handles right way roung
This commit is contained in:
parent
0db5080d49
commit
7956fda7d5
|
@ -310,16 +310,16 @@ boot = do
|
||||||
warningMessage "git pull from client failed"
|
warningMessage "git pull from client failed"
|
||||||
|
|
||||||
-- Shim for git push over the propellor ssh channel.
|
-- Shim for git push over the propellor ssh channel.
|
||||||
-- Reads from stdin and sends it to the first fd;
|
-- Reads from stdin and sends it to hout;
|
||||||
-- reads from the second fd and sends it to stdout.
|
-- reads from hin and sends it to stdout.
|
||||||
gitPush :: Fd -> Fd -> IO ()
|
gitPush :: Fd -> Fd -> IO ()
|
||||||
gitPush hin hout = void $ fromstdin `concurrently` tostdout
|
gitPush hin hout = void $ fromstdin `concurrently` tostdout
|
||||||
where
|
where
|
||||||
fromstdin = do
|
fromstdin = do
|
||||||
h <- fdToHandle hin
|
h <- fdToHandle hout
|
||||||
B.getContents >>= B.hPut h
|
B.getContents >>= B.hPut h
|
||||||
tostdout = do
|
tostdout = do
|
||||||
h <- fdToHandle hout
|
h <- fdToHandle hin
|
||||||
B.hGetContents h >>= B.putStr
|
B.hGetContents h >>= B.putStr
|
||||||
|
|
||||||
hasOrigin :: IO Bool
|
hasOrigin :: IO Bool
|
||||||
|
|
Loading…
Reference in New Issue