Repository : ssh://g...@git.haskell.org/unix On branch : master Link : http://git.haskell.org/packages/unix.git/commitdiff/b092e35f4c99bfab12247e93c7fa478de638276a
>--------------------------------------------------------------- commit b092e35f4c99bfab12247e93c7fa478de638276a Author: Bryan O'Sullivan <b...@serpentine.com> Date: Sat Oct 12 16:45:50 2013 -0700 Fix assumption that RLIM_INFINITY is a simple number On MacOS X, it is defined as "(((__uint64_t)1 << 63) - 1)", and hence cannot be used inside C preprocessor logic. >--------------------------------------------------------------- b092e35f4c99bfab12247e93c7fa478de638276a System/Posix/Resource.hsc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/System/Posix/Resource.hsc b/System/Posix/Resource.hsc index a0d0d35..58cff6f 100644 --- a/System/Posix/Resource.hsc +++ b/System/Posix/Resource.hsc @@ -95,13 +95,16 @@ packResource ResourceTotalMemory = (#const RLIMIT_AS) unpackRLimit :: CRLim -> ResourceLimit unpackRLimit (#const RLIM_INFINITY) = ResourceLimitInfinity -#if defined(RLIM_SAVED_MAX) && (RLIM_SAVED_MAX != RLIM_INFINITY) -unpackRLimit (#const RLIM_SAVED_MAX) = ResourceLimitUnknown +unpackRLimit other +#if defined(RLIM_SAVED_MAX) + | (#const RLIM_SAVED_MAX) != (#const RLIM_INFINITY) && + other == (#const RLIM_SAVED_MAX) = ResourceLimitUnknown #endif -#if defined(RLIM_SAVED_CUR) && (RLIM_SAVED_CUR != RLIM_INFINITY) -unpackRLimit (#const RLIM_SAVED_CUR) = ResourceLimitUnknown +#if defined(RLIM_SAVED_CUR) + | (#const RLIM_SAVED_CUR) != (#const RLIM_INFINITY) && + other == (#const RLIM_SAVED_CUR) = ResourceLimitUnknown #endif -unpackRLimit other = ResourceLimit (fromIntegral other) + | otherwise = ResourceLimit (fromIntegral other) packRLimit :: ResourceLimit -> Bool -> CRLim packRLimit ResourceLimitInfinity _ = (#const RLIM_INFINITY) _______________________________________________ ghc-commits mailing list ghc-commits@haskell.org http://www.haskell.org/mailman/listinfo/ghc-commits