HomeFreeBSD

fattime: fix fattime to timespec conversion of dates beyond 2106-02-06

Description

fattime: fix fattime to timespec conversion of dates beyond 2106-02-06

It turns out that the only conversion issue was in fattime2timespec, where
multiplying the number of seconds in a day by the number of days overflowed
32-bit unsigned int for dates beyond 2106-02-07 06:28:15.

Casting one of the multiplicands as time_t forces a 64-bit multiplication on
systems where time_t is 64-bits and produces no binary changes on the one
remaining system with 32-bit time_t (namely i386).

Since the code is now tested & fixed, this change removes the fixme comments.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44755

Details

Provenance
jeffpc_josefsipek.netAuthored on Apr 29 2024, 1:40 PM
tsoomeCommitted on May 1 2024, 4:56 AM
Reviewer
imp
Differential Revision
D44755: fattime: fix fattime to timespec conversion of dates beyond 2106-02-06
Parents
rG9d1396c34611: fattime: make the test code check beyond 32-bit time_t limits
Branches
Unknown
Tags
Unknown