DO NOT MERGE Fail gracefully when we fail to fork the update binary

am: de1b53d067

Change-Id: Ic7a42220ed7e842dad1d5d2aacdd12253bd5ad84
This commit is contained in:
Matthew Bouyack
2016-09-20 21:24:51 +00:00
committed by android-build-merger
+8
View File
@@ -369,6 +369,14 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache,
} }
pid_t pid = fork(); 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) { if (pid == 0) {
umask(022); umask(022);
close(pipefd[0]); close(pipefd[0]);