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

Commit 77c19899 authored by Matthew Bouyack's avatar Matthew Bouyack Committed by android-build-merger
Browse files

Fail gracefully when we fail to fork the update binary

am: c8db4817

Change-Id: I68691fb591b5819afe39e4792f9c26cc08eb87da
parents 91e3aee9 c8db4817
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -369,6 +369,14 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache,
    }

    pid_t pid = fork();

    if (pid == -1) {
        close(pipefd[0]);
        close(pipefd[1]);
        PLOG(ERROR) << "Failed to fork update binary";
        return INSTALL_ERROR;
    }

    if (pid == 0) {
        umask(022);
        close(pipefd[0]);