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:
parent
6bdbfa491f
commit
a2c51da658
@ -1278,7 +1278,7 @@ recheck_tzdata()
|
|||||||
* We want to recheck the timezone file every 61 sec.
|
* We want to recheck the timezone file every 61 sec.
|
||||||
*/
|
*/
|
||||||
error = clock_gettime(CLOCK_MONOTONIC, &now);
|
error = clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
if (error <= 0) {
|
if (error < 0) {
|
||||||
/* XXX: Can we somehow report this? */
|
/* XXX: Can we somehow report this? */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user