Lines Matching refs:fd
185 static inline bool Write8(int fd, int64_t value) { in Write8() argument
186 return android::base::WriteFully(fd, &value, sizeof(int64_t)); in Write8()
191 static inline bool Write4(int fd, int32_t value) { in Write4() argument
192 return android::base::WriteFully(fd, &value, sizeof(int32_t)); in Write4()
341 int fd = mkstemp(ptemp); in MakePatch() local
342 if (fd == -1) { in MakePatch()
346 close(fd); in MakePatch()
499 size_t PatchChunk::WriteHeaderToFd(int fd, size_t offset, size_t index) const { in WriteHeaderToFd() argument
500 Write4(fd, type_); in WriteHeaderToFd()
505 Write8(fd, static_cast<int64_t>(source_start_)); in WriteHeaderToFd()
506 Write8(fd, static_cast<int64_t>(source_len_)); in WriteHeaderToFd()
507 Write8(fd, static_cast<int64_t>(offset)); in WriteHeaderToFd()
512 Write8(fd, static_cast<int64_t>(source_start_)); in WriteHeaderToFd()
513 Write8(fd, static_cast<int64_t>(source_len_)); in WriteHeaderToFd()
514 Write8(fd, static_cast<int64_t>(offset)); in WriteHeaderToFd()
515 Write8(fd, static_cast<int64_t>(source_uncompressed_len_)); in WriteHeaderToFd()
516 Write8(fd, static_cast<int64_t>(target_uncompressed_len_)); in WriteHeaderToFd()
517 Write4(fd, target_compress_level_); in WriteHeaderToFd()
518 Write4(fd, ImageChunk::METHOD); in WriteHeaderToFd()
519 Write4(fd, ImageChunk::WINDOWBITS); in WriteHeaderToFd()
520 Write4(fd, ImageChunk::MEMLEVEL); in WriteHeaderToFd()
521 Write4(fd, ImageChunk::STRATEGY); in WriteHeaderToFd()
526 Write4(fd, static_cast<int32_t>(data_.size())); in WriteHeaderToFd()
527 if (!android::base::WriteFully(fd, data_.data(), data_.size())) { in WriteHeaderToFd()
624 android::base::unique_fd fd(open(filename.c_str(), O_RDONLY)); in ReadFile() local
625 if (fd == -1) { in ReadFile()
630 if (fstat(fd, &st) != 0) { in ReadFile()
637 if (!android::base::ReadFully(fd, file_content->data(), sz)) { in ReadFile()
641 fd.reset(); in ReadFile()
1204 android::base::unique_fd fd( in GeneratePatches() local
1207 if (fd == -1) { in GeneratePatches()
1211 if (!android::base::WriteFully(fd, split_src_images[i].PseudoSource().DataForPatch(), in GeneratePatches()
1218 fd.reset(open(patch_name.c_str(), O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR)); in GeneratePatches()
1220 if (fd == -1) { in GeneratePatches()
1224 if (!PatchChunk::WritePatchDataToFd(patch_chunks, fd)) { in GeneratePatches()
1493 android::base::unique_fd fd(open(optarg, O_RDONLY)); in imgdiff() local
1494 if (fd == -1) { in imgdiff()
1499 if (fstat(fd, &st) != 0) { in imgdiff()
1506 if (!android::base::ReadFully(fd, bonus_data.data(), bonus_size)) { in imgdiff()