commit | 340a2d364f4909c7f87afbd1d1aab1aa0abf66d4 | [log] [tgz] |
---|---|---|
author | Tao Bao <tbao@google.com> | Mon Nov 21 19:06:36 2016 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Mon Nov 21 19:06:37 2016 +0000 |
tree | 80b6f372d5756af5ba4ee4872a3464ea4a697043 | |
parent | 1d77c93bcc446971d700ca42bfc14cde207c1795 [diff] | |
parent | 10cd48da1d1c5c63e9e890c872aecc7160122f71 [diff] |
Merge "Fail gracefully when we fail to fork the update binary"
diff --git a/install.cpp b/install.cpp index 98f1e3f..f124a26 100644 --- a/install.cpp +++ b/install.cpp
@@ -373,6 +373,14 @@ } 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]);