fixed processTranscript hang problem
The pipe's FDs got inherited by ssh and it did something that kept them open even once it exited. Probably involving passing them on to the ssh mux daemon. Set close on exec, and all is well. Kept Annex.Ssh not using processTranscript even though it no longer hangs when it does use it, just because processTranscript is overkill there. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
d6700721c0
commit
d2af6baaeb
2 changed files with 20 additions and 6 deletions
|
@ -42,6 +42,8 @@ processTranscript'' cp input = do
|
|||
{- This implementation interleves stdout and stderr in exactly the order
|
||||
- the process writes them. -}
|
||||
(readf, writef) <- System.Posix.IO.createPipe
|
||||
System.Posix.IO.setFdOption readf System.Posix.IO.CloseOnExec True
|
||||
System.Posix.IO.setFdOption writef System.Posix.IO.CloseOnExec True
|
||||
readh <- System.Posix.IO.fdToHandle readf
|
||||
writeh <- System.Posix.IO.fdToHandle writef
|
||||
p@(_, _, _, pid) <- createProcess $ cp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue