[darcs-devel] [issue1524] Date conversion breaks down on NetBSD

Eric Kow bugs at darcs.net
Thu Oct 8 16:17:17 UTC 2009


Eric Kow <kowey at darcs.net> added the comment:

OK, this needs a summary.

1. On NetBSD only, we were getting a Time.toClockTime: invalid input (see
msg8169 for details)

2. To debug this, midnightmagic removed a (toCalendarTime . toClockTime) from
our function, which was:

friendly_d :: B.ByteString -> String
friendly_d d = unsafePerformIO $ do
    ct <- toCalendarTime $ toClockTime $ readPatchDate d
    return $ calendarTimeToString ct

3. This made the problem go away, but apparently we still don't have a good idea
why.  In msg8692 midnightmagic wonders: I don't know what precisely was causing the 
failure: what was it passing to mktime() that NetBSD was choking on?

The reason I ask is that NetBSD mktime includes all the fields in the struct tm 
that Linux does, plus two more optional ones (long tm_gmtoff and char *tm_zone) 
that Linux apparently doesn't, so it shouldn't have any issue with values 
passed to it. mktime is standards-compliant version on both systems

----------
assignedto: tux_rocker -> 

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1524>
__________________________________


More information about the darcs-devel mailing list