Skip to content

Commit

Permalink
Prep for tzdata file location change in SDKs > T.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 515783318
  • Loading branch information
brettchabot authored and Copybara-Service committed Mar 16, 2023
1 parent d6cf9f3 commit 1456000
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ public class ShadowMemoryMappedFileS {
private static final String TZ_DATA_1 = "/misc/zoneinfo/tzdata";
private static final String TZ_DATA_2 = "/usr/share/zoneinfo/tzdata";
private static final String TZ_DATA_3 = "/misc/zoneinfo/current/tzdata";
private static final String TZ_DATA_4 = "/etc/tz/tzdata";

@Implementation
public static MemoryMappedFile mmapRO(String path) throws Throwable {
if (path.endsWith(TZ_DATA_1) || path.endsWith(TZ_DATA_2) || path.endsWith(TZ_DATA_3)) {
if (path.endsWith(TZ_DATA_1)
|| path.endsWith(TZ_DATA_2)
|| path.endsWith(TZ_DATA_3)
|| path.endsWith(TZ_DATA_4)) {
InputStream is = MemoryMappedFile.class.getResourceAsStream(TZ_DATA_2);
if (is == null) {
throw new ErrnoException("open", -1);
Expand Down

0 comments on commit 1456000

Please sign in to comment.