Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Dec 2021 18:01:50 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a2c51da6581d - main - tzcode: fix tz change detection logic
Message-ID:  <202112211801.1BLI1oDI086514@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=a2c51da6581dbc38c60c9fc41d1b624ff2c8de97

commit a2c51da6581dbc38c60c9fc41d1b624ff2c8de97
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-12-16 02:15:38 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-12-21 18:01:24 +0000

    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
---
 contrib/tzcode/stdtime/localtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/tzcode/stdtime/localtime.c b/contrib/tzcode/stdtime/localtime.c
index 9de1b26d74a0..6a0e0ce4fe4b 100644
--- a/contrib/tzcode/stdtime/localtime.c
+++ b/contrib/tzcode/stdtime/localtime.c
@@ -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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112211801.1BLI1oDI086514>