[commit: packages/unix] master: Use `open(2)` directly rather than via `__hscore_open()` (176d73e)

git at git.haskell.org git at git.haskell.org
Tue Apr 19 21:38:21 UTC 2016


Repository : ssh://git@git.haskell.org/unix

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/176d73e4240bb9d048d6c2d411ff839e379d1245/unix

>---------------------------------------------------------------

commit 176d73e4240bb9d048d6c2d411ff839e379d1245
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Jan 31 11:32:01 2016 +0100

    Use `open(2)` directly rather than via `__hscore_open()`
    
    As we don't support Windows, there's no benefit in going via
    `__hscore_open()`


>---------------------------------------------------------------

176d73e4240bb9d048d6c2d411ff839e379d1245
 System/Posix/IO/Common.hsc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc
index 8f8ddb9..a838352 100644
--- a/System/Posix/IO/Common.hsc
+++ b/System/Posix/IO/Common.hsc
@@ -1,4 +1,6 @@
-{-# LANGUAGE NondecreasingIndentation, RecordWildCards #-}
+{-# LANGUAGE CApiFFI #-}
+{-# LANGUAGE NondecreasingIndentation #-}
+{-# LANGUAGE RecordWildCards #-}
 #if __GLASGOW_HASKELL__ >= 709
 {-# LANGUAGE Safe #-}
 #else
@@ -182,7 +184,7 @@ open_ str how maybe_mode (OpenFileFlags appendFlag exclusiveFlag nocttyFlag
                    WriteOnly -> (#const O_WRONLY)
                    ReadWrite -> (#const O_RDWR)
 
-foreign import ccall unsafe "__hscore_open"
+foreign import capi unsafe "HsUnix.h open"
    c_open :: CString -> CInt -> CMode -> IO CInt
 
 -- |Close this file descriptor.  May throw an exception if this is an



More information about the ghc-commits mailing list