summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorMatthew Bouyack <mbouyack@google.com>2016-09-20 23:24:51 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-09-20 23:24:51 +0200
commit78563fdf78861884f300a6a874d2a0306f1eb002 (patch)
treef167e66ec596b3bc07f142961bb861ae800db6f1 /install.cpp
parentCheck corruption when reading uncrypt_status file am: 41a3fd4e20 (diff)
parentDO NOT MERGE Fail gracefully when we fail to fork the update binary (diff)
downloadandroid_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.tar
android_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.tar.gz
android_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.tar.bz2
android_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.tar.lz
android_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.tar.xz
android_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.tar.zst
android_bootable_recovery-78563fdf78861884f300a6a874d2a0306f1eb002.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 71ad71f68..080f3ff70 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]);
+ LOGE("Failed to fork update binary: %s\n", strerror(errno));
+ return INSTALL_ERROR;
+ }
+
if (pid == 0) {
umask(022);
close(pipefd[0]);