[commit: packages/unix] master: Replace `__hsunix_mknod` wrapper with CApiFFI (cca358b)

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


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

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

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

commit cca358b86edc72bcb641fca362960917783b599e
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Jan 30 18:17:00 2016 +0100

    Replace `__hsunix_mknod` wrapper with CApiFFI


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

cca358b86edc72bcb641fca362960917783b599e
 System/Posix/Files.hsc            | 2 +-
 System/Posix/Files/ByteString.hsc | 2 +-
 cbits/HsUnix.c                    | 6 ------
 include/HsUnix.h                  | 3 ---
 4 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index 2df973d..d0ff4bf 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -215,7 +215,7 @@ createDevice path mode dev =
   withFilePath path $ \s ->
     throwErrnoPathIfMinus1_ "createDevice" path (c_mknod s mode dev)
 
-foreign import ccall unsafe "__hsunix_mknod"
+foreign import capi unsafe "HsUnix.h mknod"
   c_mknod :: CString -> CMode -> CDev -> IO CInt
 
 -- -----------------------------------------------------------------------------
diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc
index e560500..12bd39a 100644
--- a/System/Posix/Files/ByteString.hsc
+++ b/System/Posix/Files/ByteString.hsc
@@ -221,7 +221,7 @@ createDevice path mode dev =
   withFilePath path $ \s ->
     throwErrnoPathIfMinus1_ "createDevice" path (c_mknod s mode dev)
 
-foreign import ccall unsafe "__hsunix_mknod"
+foreign import capi unsafe "HsUnix.h mknod"
   c_mknod :: CString -> CMode -> CDev -> IO CInt
 
 -- -----------------------------------------------------------------------------
diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c
index 74112c0..dc42098 100644
--- a/cbits/HsUnix.c
+++ b/cbits/HsUnix.c
@@ -16,12 +16,6 @@ void *__hsunix_rtldNext (void) {return RTLD_NEXT;}
 void *__hsunix_rtldDefault (void) {return RTLD_DEFAULT;}
 #endif
 
-// mknod is a macro on some platforms, so we need a wrapper:
-int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev)
-{ 
-    return mknod(pathname,mode,dev);
-}
-
 #ifdef HAVE_GETPWENT
 // getpwent is a macro on some platforms, so we need a wrapper:
 struct passwd *__hsunix_getpwent(void)
diff --git a/include/HsUnix.h b/include/HsUnix.h
index def34ca..87ac3e6 100644
--- a/include/HsUnix.h
+++ b/include/HsUnix.h
@@ -113,9 +113,6 @@ fall back to O_FSYNC, which should be the same */
 # define WCOREDUMP(s) 0
 #endif
 
-// mknod is a macro on some platforms, so we need a wrapper:
-int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev);
-
 #ifdef HAVE_GETPWENT
 // getpwent is a macro on some platforms, so we need a wrapper:
 struct passwd *__hsunix_getpwent(void);



More information about the ghc-commits mailing list