1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

tzcode: fix tz change detection logic

clock_gettime() returns 0 if it succeeds, so don't capture that into the
fail logic.  With this, WITH_DETECT_TZ_CHANGES successfully detects a
change after 61 seconds.

Reviewed by:	imp, trasz
Differential Revision:	https://reviews.freebsd.org/D33494
This commit is contained in:
Kyle Evans 2021-12-15 20:15:38 -06:00
parent 6bdbfa491f
commit a2c51da658

View File

@ -1278,7 +1278,7 @@ recheck_tzdata()
* We want to recheck the timezone file every 61 sec.
*/
error = clock_gettime(CLOCK_MONOTONIC, &now);
if (error <= 0) {
if (error < 0) {
/* XXX: Can we somehow report this? */
return 0;
}