So...in the real world, does changing the zic.c lines reading... if (t >= cuthitime) break; newt = t + SECSPERHOUR * 12; if (newt >= cuthitime) break; ...to read... if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12) break; newt = t + SECSPERHOUR * 12; ...result in working code? I'd particularly appreciate feedback from Andreas Radke or other ArchLinux users. --ado
tested this with our default -O2 optimisation: --- zdump.c 2008-09-10 02:33:24.000000000 +0000 +++ zdump.c.new 2008-12-02 17:29:22.442966381 +0000 @@ -349,11 +349,9 @@ (void) strncpy(buf, abbr(&tm), (sizeof buf) - 1); } for ( ; ; ) { - if (t >= cuthitime) - break; - newt = t + SECSPERHOUR * 12; - if (newt >= cuthitime) - break; + if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12) + break; + newt = t + SECSPERHOUR * 12; if (newt <= t) break; newtmp = localtime(&newt); and it seems to work well now: [andyrtr@workstation64 trunk]$ zdump -v EUROPE/BERLIN EUROPE/BERLIN Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 20:45:52 1901 GMT isdst=0 EUROPE/BERLIN Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 20:45:52 1901 GMT isdst=0 EUROPE/BERLIN Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 03:14:07 2038 GMT isdst=0 EUROPE/BERLIN Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 03:14:07 2038 GMT isdst=0 (if this result is what it should be :S) -Andy
participants (2)
-
Andreas Radke -
Olson, Arthur David (NIH/NCI) [E]