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:
parent
376b956214
commit
d83ab035ee
Notes:
sideshowbarker
2024-07-17 11:30:54 +09:00
Author: https://github.com/negge Commit: https://github.com/LadybirdBrowser/ladybird/commit/d83ab035ee Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/72 Issue: https://github.com/LadybirdBrowser/ladybird/issues/65
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue