From 65f25756bf21ada5c8cd68c9cb934d874cc02290 Mon Sep 17 00:00:00 2001 From: Andreas Egeberg Date: Mon, 15 Feb 2021 11:40:46 +0000 Subject: [PATCH] Fix #139: System timezone changes does not 'take' in Finit The tzset() function sets the global variables 'daylight', 'timezone' and 'tzname' according to the value of the TZ environment variable, or to the value of the _CS_TIMEZONE configuration string if TZ isn't set, or to UTC0 if neither is set. Signed-off-by: Andreas Egeberg --- src/conf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/conf.c b/src/conf.c index f9857a72..dc1b10f0 100644 --- a/src/conf.c +++ b/src/conf.c @@ -29,7 +29,7 @@ #include #include #include /* BSD sys/queue.h API */ -#include +#include #include #include "finit.h" @@ -646,6 +646,11 @@ int conf_reload(void) size_t i; glob_t gl; + /* Set time according to current time zone */ + tzset(); + _d("Set time daylight: %d timezone: %ld tzname: %s %s", + daylight, timezone, tzname[0], tzname[1]); + /* Mark and sweep */ svc_mark_dynamic(); tty_mark();