diff options
| author | Neil Fuller <nfuller@google.com> | 2015-03-02 17:43:42 +0000 |
|---|---|---|
| committer | Neil Fuller <nfuller@google.com> | 2015-03-25 16:08:37 +0000 |
| commit | 1f95ffecc22995abe6ac8cdd6dbb74f6f9a42b2f (patch) | |
| tree | e316bbe9ea202ff9099d3dead7f4e68dd11c15e9 /libc/tzcode | |
| parent | dd5c92d4b0cb6c43002112ab50c1df73d06ab2aa (diff) | |
| download | bionic-1f95ffecc22995abe6ac8cdd6dbb74f6f9a42b2f.zip bionic-1f95ffecc22995abe6ac8cdd6dbb74f6f9a42b2f.tar.gz bionic-1f95ffecc22995abe6ac8cdd6dbb74f6f9a42b2f.tar.bz2 | |
Changes to re-enable overrides for tz data
Bug: 10637303
Change-Id: I5d525b66cf30d34b421803b876445596bed8d64d
Diffstat (limited to 'libc/tzcode')
| -rw-r--r-- | libc/tzcode/localtime.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index 29f605c..bf09c5e 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c @@ -2253,11 +2253,14 @@ static int __bionic_open_tzdata_path(const char* path_prefix_variable, const cha } static int __bionic_open_tzdata(const char* olson_id, int* data_size) { - int fd = __bionic_open_tzdata_path("ANDROID_ROOT", "/usr/share/zoneinfo/tzdata", olson_id, data_size); - if (fd == -2) { - // The first thing that 'recovery' does is try to format the current time. It doesn't have - // any tzdata available, so we must not abort here --- doing so breaks the recovery image! - fprintf(stderr, "%s: couldn't find any tzdata when looking for %s!\n", __FUNCTION__, olson_id); + int fd = __bionic_open_tzdata_path("ANDROID_DATA", "/misc/zoneinfo/current/tzdata", olson_id, data_size); + if (fd < 0) { + fd = __bionic_open_tzdata_path("ANDROID_ROOT", "/usr/share/zoneinfo/tzdata", olson_id, data_size); + if (fd == -2) { + // The first thing that 'recovery' does is try to format the current time. It doesn't have + // any tzdata available, so we must not abort here --- doing so breaks the recovery image! + fprintf(stderr, "%s: couldn't find any tzdata when looking for %s!\n", __FUNCTION__, olson_id); + } } return fd; } |
