summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorMatthew Bouyack <mbouyack@google.com>2016-09-17 01:38:11 +0200
committerMatthew Bouyack <mbouyack@google.com>2016-09-20 20:32:17 +0200
commitde1b53d0678b81d4480dc4ac3fc79075e01d4255 (patch)
tree06997c90a623d3435368437d4acb56f70d76078d /install.cpp
parentCheck corruption when reading uncrypt_status file (diff)
downloadandroid_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.tar
android_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.tar.gz
android_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.tar.bz2
android_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.tar.lz
android_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.tar.xz
android_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.tar.zst
android_bootable_recovery-de1b53d0678b81d4480dc4ac3fc79075e01d4255.zip
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 209300e89..78dc6a0d5 100644
--- a/install.cpp
+++ b/install.cpp
@@ -374,6 +374,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]);