diff options
author | Matthew Bouyack <mbouyack@google.com> | 2016-09-21 04:08:42 +0200 |
---|---|---|
committer | Matthew Bouyack <mbouyack@google.com> | 2016-09-21 19:06:31 +0200 |
commit | c8db4817809e163d887f7955a03ad0f97159f12b (patch) | |
tree | 9d3fc06926cabbc88ec7183437fd49cfcfb9022f | |
parent | Revert "DO NOT MERGE Fail gracefully when we fail to fork the update binary am: de1b53d067" (diff) | |
download | android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.gz android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.bz2 android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.lz android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.xz android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.zst android_bootable_recovery-c8db4817809e163d887f7955a03ad0f97159f12b.zip |
-rw-r--r-- | install.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp index 71ad71f68..d600ea330 100644 --- a/install.cpp +++ b/install.cpp @@ -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]); |