From b0a59f373ed4b8467307d938eeeb17fcab4fd524 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 26 Jan 2023 10:19:00 +0900 Subject: [PATCH] ignoring exceptons from hClose to read the next entropy --- Crypto/Random/Entropy/Unix.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Crypto/Random/Entropy/Unix.hs b/Crypto/Random/Entropy/Unix.hs index a8aae435..a79ed23a 100644 --- a/Crypto/Random/Entropy/Unix.hs +++ b/Crypto/Random/Entropy/Unix.hs @@ -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 =