sb-unix::get-timezone is broken on Windows 10
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I noticed that (get-decoded-time) always returns the wrong value on Windows 10.
(get-decoded-time) is always correct on Linux.
SBCL downloaded the binary from http://
(Linux AMD64 and Windows AMD64)
Linux (Fedora 24 64bit)
CL-USER> (get-decoded-time)
20
6
1
11
11
2016
4
NIL <- correct
-9
Windows10 (64bit)
CL-USER> (get-decoded-time)
20
6
1
11
11
2016
4
T <- incorrect
-8
I checked the cause of the bug.
sbcl-1.
(define-
(when time-t)
(daylight-
sbcl-1.
int get_timezone(time_t when, boolean *dst)
{
....
*dst = ltm.tm_isdst;
/* I added an output for debugging. */
printf("DEBUG: get_timezone(): ltm.tm_isdst is %d, *dst is %d\n", ltm.tm_isdst, *dst);
return sw;
}
$ sbcl --noinform --no-userinit --non-interactive --eval '(print (multiple-
=> (-32400 T) DEBUG: get_timezone(): ltm.tm_isdst is 0, *dst is 0
-32400(= -9 * 60 * 60) is correct.
T is incorrect.
Although *dst is 0, I do not know the reason why return value becomes T only in Windows.
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
#914612 is actually the reason for this.