commit | 78563fdf78861884f300a6a874d2a0306f1eb002 | [log] [tgz] |
---|---|---|
author | Matthew Bouyack <mbouyack@google.com> | Tue Sep 20 21:24:51 2016 +0000 |
committer | android-build-merger <android-build-merger@google.com> | Tue Sep 20 21:24:51 2016 +0000 |
tree | f167e66ec596b3bc07f142961bb861ae800db6f1 | |
parent | cc94f814362bf6f06b5078d7ab2a116f4d4b4f9a [diff] | |
parent | de1b53d0678b81d4480dc4ac3fc79075e01d4255 [diff] |
DO NOT MERGE Fail gracefully when we fail to fork the update binary am: de1b53d067 Change-Id: Ic7a42220ed7e842dad1d5d2aacdd12253bd5ad84
diff --git a/install.cpp b/install.cpp index 71ad71f..080f3ff 100644 --- a/install.cpp +++ b/install.cpp
@@ -369,6 +369,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]);