diff options
author | Matthew Bouyack <mbouyack@google.com> | 2016-09-20 23:24:51 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-09-20 23:24:51 +0200 |
commit | 78563fdf78861884f300a6a874d2a0306f1eb002 (patch) | |
tree | f167e66ec596b3bc07f142961bb861ae800db6f1 | |
parent | Check corruption when reading uncrypt_status file am: 41a3fd4e20 (diff) | |
parent | DO NOT MERGE Fail gracefully when we fail to fork the update binary (diff) | |
download | android_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 |
-rw-r--r-- | install.cpp | 8 |
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]); |