OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/service_process_util_posix.h" | 5 #include "chrome/common/service_process_util_posix.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return; | 126 return; |
127 } | 127 } |
128 #elif defined(OS_POSIX) | 128 #elif defined(OS_POSIX) |
129 initializing_lock_.reset(); | 129 initializing_lock_.reset(); |
130 #endif // OS_POSIX | 130 #endif // OS_POSIX |
131 signal->Signal(); | 131 signal->Signal(); |
132 } | 132 } |
133 | 133 |
134 ServiceProcessState::StateData::~StateData() { | 134 ServiceProcessState::StateData::~StateData() { |
135 if (sockets_[0] != -1) { | 135 if (sockets_[0] != -1) { |
136 if (HANDLE_EINTR(close(sockets_[0]))) { | 136 if (IGNORE_EINTR(close(sockets_[0]))) { |
137 DPLOG(ERROR) << "close"; | 137 DPLOG(ERROR) << "close"; |
138 } | 138 } |
139 } | 139 } |
140 if (sockets_[1] != -1) { | 140 if (sockets_[1] != -1) { |
141 if (HANDLE_EINTR(close(sockets_[1]))) { | 141 if (IGNORE_EINTR(close(sockets_[1]))) { |
142 DPLOG(ERROR) << "close"; | 142 DPLOG(ERROR) << "close"; |
143 } | 143 } |
144 } | 144 } |
145 if (set_action_) { | 145 if (set_action_) { |
146 if (sigaction(SIGTERM, &old_action_, NULL) < 0) { | 146 if (sigaction(SIGTERM, &old_action_, NULL) < 0) { |
147 DPLOG(ERROR) << "sigaction"; | 147 DPLOG(ERROR) << "sigaction"; |
148 } | 148 } |
149 } | 149 } |
150 g_signal_socket = -1; | 150 g_signal_socket = -1; |
151 } | 151 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 signal_ready.Wait(); | 189 signal_ready.Wait(); |
190 return success; | 190 return success; |
191 } | 191 } |
192 | 192 |
193 void ServiceProcessState::TearDownState() { | 193 void ServiceProcessState::TearDownState() { |
194 if (state_) { | 194 if (state_) { |
195 state_->Release(); | 195 state_->Release(); |
196 state_ = NULL; | 196 state_ = NULL; |
197 } | 197 } |
198 } | 198 } |
OLD | NEW |