summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-21 20:06:36 +0100
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-11-21 20:06:37 +0100
commit340a2d364f4909c7f87afbd1d1aab1aa0abf66d4 (patch)
tree80b6f372d5756af5ba4ee4872a3464ea4a697043
parentMerge "Call update_engine_sideload from recovery." (diff)
parentFail gracefully when we fail to fork the update binary (diff)
downloadandroid_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.tar
android_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.tar.gz
android_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.tar.bz2
android_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.tar.lz
android_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.tar.xz
android_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.tar.zst
android_bootable_recovery-340a2d364f4909c7f87afbd1d1aab1aa0abf66d4.zip
Diffstat (limited to '')
-rw-r--r--install.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp
index 98f1e3f36..f124a2688 100644
--- a/install.cpp
+++ b/install.cpp
@@ -373,6 +373,14 @@ try_update_binary(const char* path, ZipArchiveHandle 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]);