mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-25 23:40:53 +08:00
Fix current_zone not working on buildroot+glibc target - refs #846
The layout for timezones, on these targets, is `/usr/share/zoneinfo/posix/Europe/Paris` instead of `/usr/share/zoneinfo/Europe/Paris`. `/usr/share/zoneinfo/Europe/Paris` exists and is a symlink to `/usr/share/zoneinfo/posix/Europe/Paris`. `/etc/localtime` correctly links to `/usr/share/zoneinfo/Europe/Paris`, so `readlink` must be used instead of `realpath`. Signed-off-by: Julien Blanc <julien.blanc@tgcm.eu>
This commit is contained in:
parent
510a05429f
commit
dd8affc6de
@ -4187,6 +4187,8 @@ sniff_realpath(const char* timezone)
|
||||
if (rp.get() == nullptr)
|
||||
throw system_error(errno, system_category(), "realpath() failed");
|
||||
auto result = extract_tz_name(rp.get());
|
||||
if (result.find("posix") == 0)
|
||||
return false;
|
||||
return result != "posixrules";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user