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

Commit 14925d03 authored by KevMck's avatar KevMck Committed by Luca Stefani
Browse files

Adapt ijar for WSL

fix build fail because of ijar under Windows Subsystem for Linux
(based on commit b51a8cb05ae989815157d82ed86cfa3a6fbf53fc from
https://github.com/bazelbuild/bazel)

Change-Id: Ibf45c7f6afa5099e4440a8e33aac01b374ad3480
parent 55f630b6
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -197,8 +197,9 @@ class InputZipFile : public ZipExtractor {
//
class OutputZipFile : public ZipBuilder {
 public:
  OutputZipFile(int fd, u1 * const zipdata_out) :
  OutputZipFile(int fd, u1 * const zipdata_out, size_t mmap_length) :
      fd_out(fd),
      mmap_length_(mmap_length),
      zipdata_out_(zipdata_out),
      q(zipdata_out) {
    errmsg[0] = 0;
@@ -252,7 +253,7 @@ class OutputZipFile : public ZipBuilder {
  };

  int fd_out;  // file descriptor for the output file

  size_t mmap_length_;
  // OutputZipFile is responsible for maintaining the following
  // pointers. They are allocated by the Create() method before
  // the object is actually created using mmap.
@@ -933,6 +934,7 @@ size_t OutputZipFile::WriteFileSizeInLocalFileHeader(u1 *header_ptr,
int OutputZipFile::Finish() {
  if (fd_out > 0) {
    WriteCentralDirectory();
    munmap(zipdata_out_, mmap_length_);
    if (ftruncate(fd_out, GetSize()) < 0) {
      return error("ftruncate(fd_out, GetSize()): %s", strerror(errno));
    }
@@ -1001,7 +1003,7 @@ ZipBuilder* ZipBuilder::Create(const char* zip_file, u8 estimated_size) {
    return NULL;
  }

  return new OutputZipFile(fd_out, (u1*) zipdata_out);
  return new OutputZipFile(fd_out, (u1*) zipdata_out, mmap_length);
}

u8 ZipBuilder::EstimateSize(char **files) {