ThreadSafeLocalTime(): check if localtime_r() encountered error
Closed / Fixede368ba6683926255f5f109c478e91c63fbce32f9Created 3 years agoUpdated 3 years ago
Descriptionwiki2023-09-20 22:37:25
In response to bug [1237907], ThreadSafeLocalTime() checks whether localtime() encountered an error (e.g. EOVERFLOW) by checking if the return value is NULL: [96beb107b193]. The same check is needed for localtime_r() as well. See attached patch.
Referenced by2
67b8c1207fMerge [862eaba11a22af37], "Fix testcase for [00655c867e] (making it independent from timezone)", "Fix [47902ec47a]: ThreadSafeLocalTime(): remove redundant localtime() call", and "Fix [e368ba6683]: ThreadSafeLocalTime(): check if localtime_r() encountered error". check-in2024-08-22 13:44:04c94812e9a9Fix [e368ba6683]: ThreadSafeLocalTime(): check if localtime_r() encountered error check-in2023-09-21 11:04:01
chrstphrchvz Ticket [e368ba6683]: 3 changes
[History diff]2023-09-20 22:37:40
chrstphrchvzwiki2023-09-21 00:16:24
I would like to propose non-regression tests for this: see localtime-tests.diff. However I have not completely verified their portability, and maybe their formatting can be improved.
oehharwiki2024-02-07 17:36:36
As the patch was merged, it might be closed, no?
oehharwiki2024-02-07 17:37:21
Merged by commit [c94812e9a9]
chrstphrchvzwiki2024-02-16 10:38:42
If there is no interest in having non-regression tests for this (similar to those in the other attached patch) then I will not reopen this.
Log in (anonymous is fine) to add a comment.
Attachments:
- localtime-tests.diff [download] added by chrstphrchvz on 2023-09-21 00:13:36. [details]
- e368ba668392.diff [download] added by chrstphrchvz on 2023-09-20 22:41:38. [details]