aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Bouyack2016-09-20 21:08:42 -0500
committerMatthew Bouyack2016-09-21 12:06:31 -0500
commitc8db4817809e163d887f7955a03ad0f97159f12b (patch)
tree9d3fc06926cabbc88ec7183437fd49cfcfb9022f /install.cpp
parent54881abb52151ab9a4340e268c81fd3e644e9018 (diff)
downloadplatform-bootable-recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.gz
platform-bootable-recovery-c8db4817809e163d887f7955a03ad0f97159f12b.tar.xz
platform-bootable-recovery-c8db4817809e163d887f7955a03ad0f97159f12b.zip
Fail gracefully when we fail to fork the update binary
This change was original made in cw-f-dev but caused failures in nyc-mr1-dev-plus-aosp due to lack of support for 'LOGE' This version of the change uses the new 'LOG(ERROR)' style logging instead. See bug b/31395655 Test: attempt a memory intensive incremental OTA on a low-memory device Change-Id: Ia87d989a66b0ce3f48e862abf9b9d6943f70e554
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp
index 71ad71f6..d600ea33 100644
--- a/install.cpp
+++ b/install.cpp
@@ -369,6 +369,14 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache,
369 } 369 }
370 370
371 pid_t pid = fork(); 371 pid_t pid = fork();
372
373 if (pid == -1) {
374 close(pipefd[0]);
375 close(pipefd[1]);
376 PLOG(ERROR) << "Failed to fork update binary";
377 return INSTALL_ERROR;
378 }
379
372 if (pid == 0) { 380 if (pid == 0) {
373 umask(022); 381 umask(022);
374 close(pipefd[0]); 382 close(pipefd[0]);