Return true if primary cached time zone data are fresh, i.e., if this function is known to have recently returned false. A call is recent if it occurred less than tz_change_interval seconds ago. NOW should be the current time. */
| 1824 | A call is recent if it occurred less than tz_change_interval seconds ago. |
| 1825 | NOW should be the current time. */ |
| 1826 | static bool |
| 1827 | fresh_tzdata(monotime_t now) |
| 1828 | { |
| 1829 | /* If nonzero, the time of the last false return. */ |
| 1830 | static monotime_t last_checked; |
| 1831 | |
| 1832 | if (last_checked && now - last_checked < tz_change_interval) |
| 1833 | return true; |
| 1834 | last_checked = now; |
| 1835 | return false; |
| 1836 | } |
| 1837 | |
| 1838 | /* Initialize *SP to a value appropriate for the TZ setting NAME. |
| 1839 | Respect TZLOADFLAGS. |