Commit 64c0b0f
authored
tree data UPDATE do not call tzset() (#2367)
* utests - call tzset after setenv TZ
unit-tests can fail if run in an env where TZ is already set.
This is because utest.h setup calls setenv("TZ"), but does not call
tzset() immediately after that.
This causes tzname, timezone, and daylight global variables to by out of
sync from the newly set environment value of "TZ".
To fix this, explicitly call tzset().
It's unlikely that a program would call setenv("TZ") during it's
lifetime, and this should ideally only happen in a test env.
* avoid tz_set calls in ly_time functions.
It does not seem necessary to call `ly_tzset_once()` from
`ly_time_time2str()` or `ly_time_tz_offset_at()`.
If the user changes TZ env variable, they must explicitly call `tzset()`
to update the global variables `tzname`, `timezone` and `daylight`1 parent ced6435 commit 64c0b0f
2 files changed
+2
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1620 | 1620 | | |
1621 | 1621 | | |
1622 | 1622 | | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | 1623 | | |
1639 | 1624 | | |
1640 | 1625 | | |
1641 | 1626 | | |
1642 | 1627 | | |
1643 | 1628 | | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | 1629 | | |
1648 | 1630 | | |
1649 | 1631 | | |
| |||
1791 | 1773 | | |
1792 | 1774 | | |
1793 | 1775 | | |
1794 | | - | |
1795 | | - | |
1796 | | - | |
1797 | 1776 | | |
1798 | 1777 | | |
1799 | 1778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
1329 | 1331 | | |
1330 | 1332 | | |
1331 | 1333 | | |
| |||
0 commit comments