Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chromeos/process_proxy/process_proxy.cc

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chromeos/process_proxy/process_proxy.h" 5 #include "chromeos/process_proxy/process_proxy.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/ioctl.h> 9 #include <sys/ioctl.h>
10 10
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 CloseFdPair(shutdown_pipe_); 237 CloseFdPair(shutdown_pipe_);
238 } 238 }
239 239
240 void ProcessProxy::CloseFdPair(int* pipe) { 240 void ProcessProxy::CloseFdPair(int* pipe) {
241 CloseFd(&(pipe[PIPE_END_READ])); 241 CloseFd(&(pipe[PIPE_END_READ]));
242 CloseFd(&(pipe[PIPE_END_WRITE])); 242 CloseFd(&(pipe[PIPE_END_WRITE]));
243 } 243 }
244 244
245 void ProcessProxy::CloseFd(int* fd) { 245 void ProcessProxy::CloseFd(int* fd) {
246 if (*fd != kInvalidFd) { 246 if (*fd != kInvalidFd) {
247 if (HANDLE_EINTR(close(*fd)) != 0) 247 if (IGNORE_EINTR(close(*fd)) != 0)
248 DPLOG(WARNING) << "close fd failed."; 248 DPLOG(WARNING) << "close fd failed.";
249 } 249 }
250 *fd = kInvalidFd; 250 *fd = kInvalidFd;
251 } 251 }
252 252
253 void ProcessProxy::ClearAllFdPairs() { 253 void ProcessProxy::ClearAllFdPairs() {
254 ClearFdPair(pt_pair_); 254 ClearFdPair(pt_pair_);
255 ClearFdPair(shutdown_pipe_); 255 ClearFdPair(shutdown_pipe_);
256 } 256 }
257 257
258 void ProcessProxy::ClearFdPair(int* pipe) { 258 void ProcessProxy::ClearFdPair(int* pipe) {
259 pipe[PIPE_END_READ] = kInvalidFd; 259 pipe[PIPE_END_READ] = kInvalidFd;
260 pipe[PIPE_END_WRITE] = kInvalidFd; 260 pipe[PIPE_END_WRITE] = kInvalidFd;
261 } 261 }
262 262
263 } // namespace chromeos 263 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/process_proxy/process_output_watcher_unittest.cc ('k') | chromeos/process_proxy/process_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698