Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5d7abe3 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

zip_archive: Improve error message on fallocate failure.

Noticed on b/30765660.

Change-Id: I1a98f83fef02a7368bdc2e1f8f24a0771eebe468
parent c97b73aa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -819,8 +819,9 @@ class FileWriter : public Writer {
      // disk does not have enough space.
      result = TEMP_FAILURE_RETRY(fallocate(fd, 0, current_offset, declared_length));
      if (result == -1 && errno == ENOSPC) {
        ALOGW("Zip: unable to allocate space for file to %" PRId64 ": %s",
              static_cast<int64_t>(declared_length + current_offset), strerror(errno));
        ALOGW("Zip: unable to allocate  %" PRId64 " bytes at offset %" PRId64 " : %s",
              static_cast<int64_t>(declared_length), static_cast<int64_t>(current_offset),
              strerror(errno));
        return std::unique_ptr<FileWriter>(nullptr);
      }
    }