.
D 2023-11-20T13:56:06.799
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment In\sConvertLocalToUTCUsingC,\swe\suse\smktime\sthen\scheck\serrno\swithout\schecking\swhether\smktime\sreturned\san\serror,\si.e.,\s-1.\r\n\r\nAs\snicely\sexplained\sin\s[https://mm.icann.org/pipermail/tz/2016-July/023904.html|this\sthread\son\sthe\stz\smailing\slist],\sdoing\sso\sis\san\serror.\r\n\r\nAs\sit\sturns\sout,\sin\sFreeBSD\swe\suse\sa\sversion\sof\stz's\scode\sthat\ssets\serrno\sinternally\seven\son\sthe\ssuccess\spath.\sThis\sresults\sin\s[clock\sscan]\serroring\sout\seven\son\svalid\sinput:\r\n\r\n<verbatim\stype=tcl>\r\nclock\sscan\s2000-01-01T00:00:00\s-timezone\s:localtime\s\s-format\s%Y-%m-%dT%H:%M:%S\r\ntime\svalue\stoo\slarge/small\sto\srepresent\r\n</verbatim>\r\n\r\nHere's\sthe\spatch\sI\ssuggest:\r\n\r\n<verbatim\stype=diff>\r\n---\sgeneric/tclClock.c.orig\s\s\s\s\s2023-11-03\s19:56:24.000000000\s+0000\r\n+++\sgeneric/tclClock.c\s\s2023-11-20\s13:49:18.128631000\s+0000\r\n@@\s-894,7\s+894,7\s@@\r\n\s\s\s\s\sTcl_MutexLock(&clockMutex);\r\n\s\s\s\s\serrno\s=\s0;\r\n\s\s\s\s\sfields->seconds\s=\s(Tcl_WideInt)\smktime(&timeVal);\r\n-\s\s\s\slocalErrno\s=\serrno;\r\n+\s\s\s\slocalErrno\s=\sfields->seconds\s==\s-1\s?\serrno\s:\s0;\r\n\s\s\s\s\sTcl_MutexUnlock(&clockMutex);\r\n\s\r\n\s\s\s\s\s/*\r\n</verbatim>
J foundin 9.0
J is_private 0
J login gahr
J priority 5\sMedium
J private_contact 438e59f1f1c891b29d2528ed82d1e629cecc6336
J resolution None
J severity Important
J status Open
J submitter gahr
J subsystem 06.\sTime\sMeasurement
J title clock\sformat\sreturns\sspurious\serrors
J type Bug
K 32b88975f794c39d29308ec8bcd4aafd779f220a
U gahr
Z 0036bbe8cacc172a358bea4bef796b1c