close send side of password pipe on exec
This avoids a hang approximately 1% of the time when running the test suite on StatelessOpenPGP. Since I've not seen git-annex hang when running git like that, I guess git probably does something that avoids hanging similarly. Still, fixed the same problem in Utility.Gpg too. Sponsored-by: Kevin Mueller on Patreon
This commit is contained in:
parent
60366e73e0
commit
790600f7b2
2 changed files with 2 additions and 0 deletions
|
@ -163,6 +163,7 @@ feedRead cmd params passphrase feeder reader = do
|
|||
let setup = liftIO $ do
|
||||
-- pipe the passphrase into gpg on a fd
|
||||
(frompipe, topipe) <- System.Posix.IO.createPipe
|
||||
setFdOption topipe CloseOnExec True
|
||||
toh <- fdToHandle topipe
|
||||
t <- async $ do
|
||||
B.hPutStr toh (passphrase <> "\n")
|
||||
|
|
|
@ -133,6 +133,7 @@ feedRead cmd subcmd params password emptydirectory feeder reader = do
|
|||
let setup = liftIO $ do
|
||||
-- pipe the passphrase in on a fd
|
||||
(frompipe, topipe) <- System.Posix.IO.createPipe
|
||||
setFdOption topipe CloseOnExec True
|
||||
toh <- fdToHandle topipe
|
||||
t <- async $ do
|
||||
B.hPutStr toh (password <> "\n")
|
||||
|
|
Loading…
Add table
Reference in a new issue