diff options
-rw-r--r-- | System/Posix/Directory/Common.hsc | 8 | ||||
-rw-r--r-- | changelog.md | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/System/Posix/Directory/Common.hsc b/System/Posix/Directory/Common.hsc index 86d87ca..7cc61af 100644 --- a/System/Posix/Directory/Common.hsc +++ b/System/Posix/Directory/Common.hsc @@ -62,20 +62,20 @@ newtype DirStreamOffset = DirStreamOffset COff #ifdef HAVE_SEEKDIR seekDirStream :: DirStream -> DirStreamOffset -> IO () seekDirStream (DirStream dirp) (DirStreamOffset off) = - c_seekdir dirp off + c_seekdir dirp (fromIntegral off) -- TODO: check for CLong/COff overflow foreign import ccall unsafe "seekdir" - c_seekdir :: Ptr CDir -> COff -> IO () + c_seekdir :: Ptr CDir -> CLong -> IO () #endif #ifdef HAVE_TELLDIR tellDirStream :: DirStream -> IO DirStreamOffset tellDirStream (DirStream dirp) = do off <- c_telldir dirp - return (DirStreamOffset off) + return (DirStreamOffset (fromIntegral off)) -- TODO: check for overflow foreign import ccall unsafe "telldir" - c_telldir :: Ptr CDir -> IO COff + c_telldir :: Ptr CDir -> IO CLong #endif changeWorkingDirectoryFd :: Fd -> IO () diff --git a/changelog.md b/changelog.md index ae5b726..c481922 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,4 @@ +<<<<<<< HEAD # Changelog for [`unix` package](http://hackage.haskell.org/package/unix) ## 2.7.0.2 *TBA* @@ -9,6 +10,7 @@ CPP macros for required getgrgid_r and getgrnam_r functions definition so the fix is to change from C ABI calling convention to C API calling convention + * Fix potential type-mismatch in `telldir`/`seekdir` FFI imports ## 2.7.0.1 *Mar 2014* |