diff options
author | Matthew Bouyack <mbouyack@google.com> | 2016-09-26 20:02:33 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-09-26 20:02:33 +0200 |
commit | 77c19899fb2edfa0e67f99f1355a2965fae61ed3 (patch) | |
tree | 88d16b49620404e37e267d79799534641e6f1010 | |
parent | Switch to <android-base/properties.h>. (diff) | |
parent | Fail gracefully when we fail to fork the update binary (diff) | |
download | android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.tar android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.tar.gz android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.tar.bz2 android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.tar.lz android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.tar.xz android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.tar.zst android_bootable_recovery-77c19899fb2edfa0e67f99f1355a2965fae61ed3.zip |
-rw-r--r-- | install.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp index 71ad71f68..d600ea330 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]); + PLOG(ERROR) << "Failed to fork update binary"; + return INSTALL_ERROR; + } + if (pid == 0) { umask(022); close(pipefd[0]); |