musl: time-util: introduce get_tzname() helper function

musl leaves the DST timezone name unset if there is no DST.
The helper function maps that back to no DST.
This commit is contained in:
Yu Watanabe
2025-11-13 03:13:55 +09:00
parent 3ac4d68498
commit 6431f2e072
6 changed files with 24 additions and 16 deletions
+2 -2
View File
@@ -733,9 +733,9 @@ static int method_set_timezone(sd_bus_message *m, void *userdata, sd_bus_error *
log_struct(LOG_INFO,
LOG_MESSAGE_ID(SD_MESSAGE_TIMEZONE_CHANGE_STR),
LOG_ITEM("TIMEZONE=%s", c->zone),
LOG_ITEM("TIMEZONE_SHORTNAME=%s", tzname[daylight]),
LOG_ITEM("TIMEZONE_SHORTNAME=%s", get_tzname(daylight)),
LOG_ITEM("DAYLIGHT=%i", daylight),
LOG_MESSAGE("Changed time zone to '%s' (%s).", c->zone, tzname[daylight]));
LOG_MESSAGE("Changed time zone to '%s' (%s).", c->zone, get_tzname(daylight)));
(void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m),
"/org/freedesktop/timedate1", "org.freedesktop.timedate1", "Timezone",