Commit 8aff21b7 by Abseil Team Committed by Copybara-Service

Import of CCTZ from GitHub.

PiperOrigin-RevId: 580538328
Change-Id: I2699c77eeb68708584231d86ae2c0fca4870c17e
parent 866b0fb5
......@@ -474,7 +474,8 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
// See Android's libc/tzcode/bionic.cpp for additional information.
for (const char* tzdata : {"/data/misc/zoneinfo/current/tzdata",
for (const char* tzdata : {"/apex/com.android.tzdata/etc/tz/tzdata",
"/data/misc/zoneinfo/current/tzdata",
"/system/usr/share/zoneinfo/tzdata"}) {
auto fp = FOpen(tzdata, "rb");
if (fp == nullptr) continue;
......@@ -539,9 +540,16 @@ std::unique_ptr<ZoneInfoSource> FuchsiaZoneInfoSource::Open(
// Prefixes where a Fuchsia component might find zoneinfo files,
// in descending order of preference.
const auto kTzdataPrefixes = {
// The tzdata from `config-data`.
"/config/data/tzdata/",
// The tzdata bundled in the component's package.
"/pkg/data/tzdata/",
// General data storage.
"/data/tzdata/",
// The recommended path for routed-in tzdata files.
// See for details:
// https://fuchsia.dev/fuchsia-src/concepts/process/namespaces?hl=en#typical_directory_structure
"/config/tzdata/",
};
const auto kEmptyPrefix = {""};
const bool name_absolute = (pos != name.size() && name[pos] == '/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment