Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147988106
D44755.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44755.id.diff
View Options
diff --git a/sys/kern/subr_fattime.c b/sys/kern/subr_fattime.c
--- a/sys/kern/subr_fattime.c
+++ b/sys/kern/subr_fattime.c
@@ -63,11 +63,6 @@
* FAT timestamps have 7 bits for the year and starts at 1980, so
* they can represent up to 2107 which means that the non-leap-year
* 2100 must be handled.
- *
- * XXX: As long as time_t is 32 bits this is not relevant or easily
- * XXX: testable. Revisit when time_t grows bigger.
- * XXX: grepfodder: 64 bit time_t, y2100, y2.1k, 2100, leap year
- *
*/
#include <sys/param.h>
@@ -165,10 +160,7 @@
} else {
t2 -= T1980;
- /*
- * 2100 is not a leap year.
- * XXX: a 32 bit time_t can not get us here.
- */
+ /* 2100 is not a leap year */
if (t2 >= ((2100 - 1980) / 4 * LYC + FEB))
t2++;
@@ -242,17 +234,14 @@
/* Month offset from leap-year cycle */
day += daytab[(dd >> 5) & 0x3f];
- /*
- * 2100 is not a leap year.
- * XXX: a 32 bit time_t can not get us here.
- */
+ /* 2100 is not a leap year */
if (day >= ((2100 - 1980) / 4 * LYC + FEB))
day--;
/* Align with time_t epoch */
day += T1980;
- tsp->tv_sec += DAY * day;
+ tsp->tv_sec += (time_t) DAY * day;
if (!utc)
tsp->tv_sec += utc_offset();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 16, 1:22 AM (11 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29745912
Default Alt Text
D44755.id.diff (1 KB)
Attached To
Mode
D44755: fattime: fix fattime to timespec conversion of dates beyond 2106-02-06
Attached
Detach File
Event Timeline
Log In to Comment