From 7a2f3f41b4492c9d2e846ebd832ba7ddbaf063ac Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Sat, 30 Jan 2016 18:13:39 +0100 Subject: Replace `__hsunix_lstat` wrapper with CApiFFI --- System/Posix/Files.hsc | 2 +- System/Posix/Files/ByteString.hsc | 2 +- cbits/HsUnix.c | 6 ------ include/HsUnix.h | 5 +---- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc index b18a8df..2df973d 100644 --- a/System/Posix/Files.hsc +++ b/System/Posix/Files.hsc @@ -187,7 +187,7 @@ getSymbolicLinkStatus path = do throwErrnoPathIfMinus1_ "getSymbolicLinkStatus" path (c_lstat s p) return (FileStatus fp) -foreign import ccall unsafe "__hsunix_lstat" +foreign import capi unsafe "HsUnix.h lstat" c_lstat :: CString -> Ptr CStat -> IO CInt -- | @createNamedPipe fifo mode@ diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc index 3f26f73..e560500 100644 --- a/System/Posix/Files/ByteString.hsc +++ b/System/Posix/Files/ByteString.hsc @@ -193,7 +193,7 @@ getSymbolicLinkStatus path = do throwErrnoPathIfMinus1_ "getSymbolicLinkStatus" path (c_lstat s p) return (FileStatus fp) -foreign import ccall unsafe "__hsunix_lstat" +foreign import capi unsafe "HsUnix.h lstat" c_lstat :: CString -> Ptr CStat -> IO CInt -- | @createNamedPipe fifo mode@ diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c index a0b15e9..74112c0 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 -// lstat is a macro on some platforms, so we need a wrapper: -int __hsunix_lstat(const char *path, struct stat *buf) -{ - return lstat(path,buf); -} - // mknod is a macro on some platforms, so we need a wrapper: int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev) { diff --git a/include/HsUnix.h b/include/HsUnix.h index a6bba9a..def34ca 100644 --- a/include/HsUnix.h +++ b/include/HsUnix.h @@ -113,10 +113,7 @@ fall back to O_FSYNC, which should be the same */ # define WCOREDUMP(s) 0 #endif -// lstat is a macro on some platforms, so we need a wrapper: -int __hsunix_lstat(const char *path, struct stat *buf); - -// lstat is a macro on some platforms, so we need a wrapper: +// 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 -- cgit v1.2.3