Fail gracefully when we fail to fork the update binary

am: c8db481780

Change-Id: I68691fb591b5819afe39e4792f9c26cc08eb87da
This commit is contained in:
Matthew Bouyack
2016-09-26 18:02:33 +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();
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]);