Lines Matching refs:fd
115 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY | O_CLOEXEC)); in __bionic_open_tzdata_path() local
116 if (fd == -1) { in __bionic_open_tzdata_path()
123 ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fd, &header, sizeof(header))); in __bionic_open_tzdata_path()
127 close(fd); in __bionic_open_tzdata_path()
133 close(fd); in __bionic_open_tzdata_path()
137 if (TEMP_FAILURE_RETRY(lseek(fd, ntohl(header.index_offset), SEEK_SET)) == -1) { in __bionic_open_tzdata_path()
139 close(fd); in __bionic_open_tzdata_path()
146 close(fd); in __bionic_open_tzdata_path()
152 close(fd); in __bionic_open_tzdata_path()
159 close(fd); in __bionic_open_tzdata_path()
162 if (TEMP_FAILURE_RETRY(read(fd, index, index_size)) != static_cast<ssize_t>(index_size)) { in __bionic_open_tzdata_path()
166 close(fd); in __bionic_open_tzdata_path()
192 close(fd); in __bionic_open_tzdata_path()
196 if (TEMP_FAILURE_RETRY(lseek(fd, specific_zone_offset, SEEK_SET)) == -1) { in __bionic_open_tzdata_path()
199 close(fd); in __bionic_open_tzdata_path()
203 return fd; in __bionic_open_tzdata_path()
207 int fd; in __bionic_open_tzdata() local
223 fd = __bionic_open_tzdata_path("/data/misc/zoneinfo/current/tzdata", in __bionic_open_tzdata()
225 if (fd >= -1) return fd; in __bionic_open_tzdata()
227 fd = __bionic_open_tzdata_path("/apex/com.android.tzdata/etc/tz/tzdata", in __bionic_open_tzdata()
229 if (fd >= -1) return fd; in __bionic_open_tzdata()
231 fd = __bionic_open_tzdata_path("/system/usr/share/zoneinfo/tzdata", in __bionic_open_tzdata()
233 if (fd >= -1) return fd; in __bionic_open_tzdata()
241 fd = __bionic_open_tzdata_path(path, olson_id, entry_length); in __bionic_open_tzdata()
243 if (fd >= -1) return fd; in __bionic_open_tzdata()
246 fd = __bionic_open_tzdata_path(path, olson_id, entry_length); in __bionic_open_tzdata()
248 if (fd >= -1) return fd; in __bionic_open_tzdata()
251 fd = __bionic_open_tzdata_path(path, olson_id, entry_length); in __bionic_open_tzdata()
253 if (fd >= -1) return fd; in __bionic_open_tzdata()
258 if (fd == -2) { in __bionic_open_tzdata()
265 return fd; in __bionic_open_tzdata()