@@ -34,7 +34,7 @@ import Data.ByteString.Internal as B
34#undef HAVE_RDRAND
34#undef HAVE_RDRAND
37−import System.Posix (openFd, closeFd, fdReadBuf, OpenMode(..), defaultFileFlags, Fd)
37+import System.Posix (openFd, closeFd, fdReadBuf, OpenMode(..), defaultFileFlags, Fd, OpenFileFlags(..))
39source :: FilePath
39source :: FilePath
40source = "/dev/urandom"
40source = "/dev/urandom"
@@ -75,7 +75,11 @@ openHandle =
75openRandomFile :: IO Fd
75openRandomFile :: IO Fd
76openRandomFile = do
76openRandomFile = do
77 evaluate ensurePoolInitialized
77 evaluate ensurePoolInitialized
78+#if MIN_VERSION_unix(2,8,0)
79+ openFd source ReadOnly defaultFileFlags { creat = Nothing }
78 openFd source ReadOnly Nothing defaultFileFlags
81 openFd source ReadOnly Nothing defaultFileFlags
80-- |Close the `CryptHandle`
84-- |Close the `CryptHandle`
81closeHandle :: CryptHandle -> IO ()
85closeHandle :: CryptHandle -> IO ()