Repository : ssh://[email protected]/time On branch : ghc-head Link : http://git.haskell.org/?p=packages/time.git;a=commit;h=3e15640c74939e8929c46f15eaa7bc48cc79be66
>--------------------------------------------------------------- commit 3e15640c74939e8929c46f15eaa7bc48cc79be66 Author: Dylan Simon <[email protected]> Date: Sat Jan 26 02:59:54 2013 +0000 use throwErrnoIfMinus1 gettimeofday for consistency in error handling >--------------------------------------------------------------- 3e15640c74939e8929c46f15eaa7bc48cc79be66 Data/Time/Clock/CTimeval.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Data/Time/Clock/CTimeval.hs b/Data/Time/Clock/CTimeval.hs index 5e0ffdf..b0d8920 100644 --- a/Data/Time/Clock/CTimeval.hs +++ b/Data/Time/Clock/CTimeval.hs @@ -25,10 +25,8 @@ foreign import ccall unsafe "time.h gettimeofday" gettimeofday :: Ptr CTimeval - -- | Get the current POSIX time from the system clock. getCTimeval :: IO CTimeval getCTimeval = with (MkCTimeval 0 0) (\ptval -> do - result <- gettimeofday ptval nullPtr - if (result == 0) - then peek ptval - else fail ("error in gettimeofday: " ++ (show result)) + throwErrnoIfMinus1_ "gettimeofday" $ gettimeofday ptval nullPtr + peek ptval ) #endif _______________________________________________ ghc-commits mailing list [email protected] http://www.haskell.org/mailman/listinfo/ghc-commits
