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

Commit 111663d8 authored by Bill Peckham's avatar Bill Peckham Committed by android-build-merger
Browse files

Merge "Use flags = 0 to avoid fd closing for child updater process"

am: 50bda24f

Change-Id: I0ddb3f3cb29d63922f0c3972e5800f03bd5a85ac
parents 7367caad 50bda24f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -342,7 +342,9 @@ static int try_update_binary(const std::string& package, ZipArchiveHandle zip, b

  // The updater in child process writes to the pipe to communicate with recovery.
  android::base::unique_fd pipe_read, pipe_write;
  if (!android::base::Pipe(&pipe_read, &pipe_write)) {
  // Explicitly disable O_CLOEXEC using 0 as the flags (last) parameter to Pipe
  // so that the child updater process will recieve a non-closed fd.
  if (!android::base::Pipe(&pipe_read, &pipe_write, 0)) {
    PLOG(ERROR) << "Failed to create pipe for updater-recovery communication";
    return INSTALL_CORRUPT;
  }