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

Commit de1b53d0 authored by Matthew Bouyack's avatar Matthew Bouyack
Browse files

DO NOT MERGE Fail gracefully when we fail to fork the update binary

See bug b/31395655

Change-Id: Ic5a046bc80ea88d7eb52755838bdbf4e1e47da50
parent 914f39d2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -374,6 +374,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]);
        LOGE("Failed to fork update binary: %s\n", strerror(errno));
        return INSTALL_ERROR;
    }

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