LibTimeZone: Read /etc/timezone for current TZ

Fallback to reading /etc/timezone by calling system_time_zone() when
unable determine time zone from /etc/localtime.
This works on systems where /etc/localtime is a file and not a symlink.

Fixes #65
This commit is contained in:
Nathan E. Egge 2024-06-05 21:08:35 -04:00 committed by Tim Flynn
parent 376b956214
commit d83ab035ee
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00

View file

@ -129,7 +129,8 @@ StringView current_time_zone()
dbgln_if(TIME_ZONE_DEBUG, "Could not read the /etc/localtime link: {}", strerror(errno));
}
return "UTC"sv;
// Read the system timezone file /etc/timezone
return system_time_zone();
#endif
}