aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/IO
diff options
context:
space:
mode:
Diffstat (limited to 'System/Posix/IO')
-rw-r--r--System/Posix/IO/ByteString.hsc2
-rw-r--r--System/Posix/IO/Common.hsc8
2 files changed, 3 insertions, 7 deletions
diff --git a/System/Posix/IO/ByteString.hsc b/System/Posix/IO/ByteString.hsc
index b8bc87a..d387f0e 100644
--- a/System/Posix/IO/ByteString.hsc
+++ b/System/Posix/IO/ByteString.hsc
@@ -1,6 +1,6 @@
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
-#elif __GLASGOW_HASKELL__ >= 703
+#else
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc
index abcd19b..8f8ddb9 100644
--- a/System/Posix/IO/Common.hsc
+++ b/System/Posix/IO/Common.hsc
@@ -1,7 +1,7 @@
{-# LANGUAGE NondecreasingIndentation, RecordWildCards #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
-#elif __GLASGOW_HASKELL__ >= 703
+#else
{-# LANGUAGE Trustworthy #-}
#endif
@@ -70,14 +70,12 @@ import qualified System.Posix.Internals as Base
import Foreign
import Foreign.C
-#ifdef __GLASGOW_HASKELL__
import GHC.IO.Handle.Internals
import GHC.IO.Handle.Types
import qualified GHC.IO.FD as FD
import qualified GHC.IO.Handle.FD as FD
import GHC.IO.Exception
import Data.Typeable (cast)
-#endif
#include "HsUnix.h"
@@ -206,8 +204,8 @@ handleToFd :: Handle -> IO Fd
-- | Converts an 'Fd' into a 'Handle' that can be used with the
-- standard Haskell IO library (see "System.IO").
fdToHandle :: Fd -> IO Handle
+fdToHandle fd = FD.fdToHandle (fromIntegral fd)
-#ifdef __GLASGOW_HASKELL__
handleToFd h@(FileHandle _ m) = do
withHandle' "handleToFd" h m $ handleToFd' h
handleToFd h@(DuplexHandle _ r w) = do
@@ -231,8 +229,6 @@ handleToFd' h h_@Handle__{haType=_,..} = do
FD.release fd
return (Handle__{haType=ClosedHandle,..}, Fd (FD.fdFD fd))
-fdToHandle fd = FD.fdToHandle (fromIntegral fd)
-#endif
-- -----------------------------------------------------------------------------
-- Fd options