summaryrefslogtreecommitdiff
path: root/Utility/Gpg.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-09 13:11:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-09 13:11:54 -0400
commitc6f3c410d4f555fe2c989780ddbddd6b37e59096 (patch)
tree5eb157287be90bb6dc7ded924a218e744abe346a /Utility/Gpg.hs
parent4eb6a2966a17dda80c7c09da8158258e6541ac7f (diff)
fix gpg pipeline stall
Bug introduced in d1da9cf221aeea5c7ac8a313a18b559791a04f12, where I removed a forkProcess when feeding gpg. Feeding it from a thread solves the bug.
Diffstat (limited to 'Utility/Gpg.hs')
-rw-r--r--Utility/Gpg.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs
index 923f6d5be..8d25272d3 100644
--- a/Utility/Gpg.hs
+++ b/Utility/Gpg.hs
@@ -64,7 +64,7 @@ passphraseHandle :: [CommandParam] -> String -> IO L.ByteString -> (Handle -> IO
passphraseHandle params passphrase a b = do
-- pipe the passphrase into gpg on a fd
(frompipe, topipe) <- createPipe
- _ <- forkIO $ do
+ void $ forkIO $ do
toh <- fdToHandle topipe
hPutStrLn toh passphrase
hClose toh
@@ -76,8 +76,9 @@ passphraseHandle params passphrase a b = do
withBothHandles createProcessSuccess (proc "gpg" params') go
where
go (to, from) = do
- L.hPut to =<< a
- hClose to
+ void $ forkIO $ do
+ L.hPut to =<< a
+ hClose to
b from
{- Finds gpg public keys matching some string. (Could be an email address,