Merge "fastboot: Fix fastboot_vendor_boot_img_utils_test mac os compilation" am: 18b6e9b819

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2463156

Change-Id: Iaf240e3f1fa981a1d49021a458cc7c0f64902a5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-03-01 17:44:55 +00:00 committed by Automerger Merge Worker
commit c5d45ccbb0

View file

@ -73,8 +73,8 @@ Result<uint64_t> FileSize(borrowed_fd fd, std::filesystem::path path) {
// Seek to beginning then read the whole file.
Result<std::string> ReadStartOfFdToString(borrowed_fd fd, std::filesystem::path path) {
if (lseek64(fd.get(), 0, SEEK_SET) != 0)
return ErrnoError() << "lseek64(" << path << ", 0, SEEK_SET)";
if (lseek(fd.get(), 0, SEEK_SET) != 0)
return ErrnoError() << "lseek(" << path << ", 0, SEEK_SET)";
std::string content;
if (!android::base::ReadFdToString(fd, &content)) return ErrnoError() << "read(" << path << ")";
return content;