commit | de1b53d0678b81d4480dc4ac3fc79075e01d4255 | [log] [tgz] |
---|---|---|
author | Matthew Bouyack <mbouyack@google.com> | Fri Sep 16 16:38:11 2016 -0700 |
committer | Matthew Bouyack <mbouyack@google.com> | Tue Sep 20 11:32:17 2016 -0700 |
tree | 06997c90a623d3435368437d4acb56f70d76078d | |
parent | 914f39d2d35fa58ad83103e1005637f2a34615d3 [diff] |
DO NOT MERGE Fail gracefully when we fail to fork the update binary See bug b/31395655 Change-Id: Ic5a046bc80ea88d7eb52755838bdbf4e1e47da50
diff --git a/install.cpp b/install.cpp index 209300e..78dc6a0 100644 --- a/install.cpp +++ b/install.cpp
@@ -374,6 +374,14 @@ } 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]);