Skip to content

Commit

Permalink
Merge pull request #1 from kazu-yamamoto/close-dev-random
Browse files Browse the repository at this point in the history
ignoring exceptons from hClose to read the next entropy
  • Loading branch information
kazu-yamamoto authored Jun 5, 2023
2 parents d163f69 + b0a59f3 commit 0102384
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Crypto/Random/Entropy/Unix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ withDev filepath f = openDev filepath >>= \h ->
Just fd -> f fd `E.finally` closeDev fd

closeDev :: H -> IO ()
closeDev h = hClose h
closeDev h = hClose h `E.catch` \(_ :: IOException) -> return ()

gatherDevEntropy :: H -> Ptr Word8 -> Int -> IO Int
gatherDevEntropy h ptr sz =
Expand Down

0 comments on commit 0102384

Please sign in to comment.