OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 30 matching lines...) Expand all Loading... |
41 arguments_ = *arguments; | 41 arguments_ = *arguments; |
42 } else { | 42 } else { |
43 arguments_.clear(); | 43 arguments_.clear(); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 MultiprocessExec::~MultiprocessExec() { | 47 MultiprocessExec::~MultiprocessExec() { |
48 } | 48 } |
49 | 49 |
50 void MultiprocessExec::PreFork() { | 50 void MultiprocessExec::PreFork() { |
51 Multiprocess::PreFork(); | 51 ASSERT_NO_FATAL_FAILURE(Multiprocess::PreFork()); |
52 if (testing::Test::HasFatalFailure()) { | |
53 return; | |
54 } | |
55 | 52 |
56 ASSERT_FALSE(command_.empty()); | 53 ASSERT_FALSE(command_.empty()); |
57 | 54 |
58 // Build up the argv vector. This is done in PreFork() instead of | 55 // Build up the argv vector. This is done in PreFork() instead of |
59 // MultiprocessChild() because although the result is only needed in the child | 56 // MultiprocessChild() because although the result is only needed in the child |
60 // process, building it is a hazardous operation in that process. | 57 // process, building it is a hazardous operation in that process. |
61 ASSERT_TRUE(argv_.empty()); | 58 ASSERT_TRUE(argv_.empty()); |
62 | 59 |
63 argv_.push_back(command_.c_str()); | 60 argv_.push_back(command_.c_str()); |
64 for (const std::string& argument : arguments_) { | 61 for (const std::string& argument : arguments_) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 IGNORE_EINTR(close(STDOUT_FILENO)); | 131 IGNORE_EINTR(close(STDOUT_FILENO)); |
135 HANDLE_EINTR(dup2(dup_orig_stdout_fd, STDOUT_FILENO)); | 132 HANDLE_EINTR(dup2(dup_orig_stdout_fd, STDOUT_FILENO)); |
136 IGNORE_EINTR(close(dup_orig_stdout_fd)); | 133 IGNORE_EINTR(close(dup_orig_stdout_fd)); |
137 | 134 |
138 forbid_return.Disarm(); | 135 forbid_return.Disarm(); |
139 FAIL() << ErrnoMessage("execv") << ": " << argv_[0]; | 136 FAIL() << ErrnoMessage("execv") << ": " << argv_[0]; |
140 } | 137 } |
141 | 138 |
142 } // namespace test | 139 } // namespace test |
143 } // namespace crashpad | 140 } // namespace crashpad |
OLD | NEW |