darcs patch: Fix #4970 (time002 and time004 test failures on darwin)

gwright at antiope.com gwright at antiope.com
Fri Mar 4 21:40:06 CET 2011

1 patch for repository http://darcs.haskell.org/ghc-7.0/packages/old-time:

Fri Mar  4 13:05:00 EST 2011  gwright at antiope.com
  * Fix #4970 (time002 and time004 test failures on darwin)
  This patch fixes #4970.  The tv_usec field of struct timeval has type
  __int32_t, but getClockTime treats it as 64 bits.  Because allocaBytes
  doesn't zero its memory, garbage can end up in the upper 32 bits.
  This causes a "picoseconds out of range" error in test002 and test004.
  The fix is to change the cast of (#peek struct timeval,tv_usec) p_timeval
  from "IO CTime" to "IO CInt" on darwin.  The usec value is then handled
  I have no idea why this is only seen when the tests are run interactively
  but not in compiled code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 1381 bytes
Desc: A darcs patch for your repository!
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110304/862dd64a/attachment.bin>

More information about the Libraries mailing list