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

Side by Side Diff: chromeos/dbus/debug_daemon_client.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/dbus/debug_daemon_client.h" 5 #include "chromeos/dbus/debug_daemon_client.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 explicit PipeReader(IOCompleteCallback callback) 49 explicit PipeReader(IOCompleteCallback callback)
50 : io_buffer_(new net::IOBufferWithSize(4096)), 50 : io_buffer_(new net::IOBufferWithSize(4096)),
51 callback_(callback), 51 callback_(callback),
52 weak_ptr_factory_(this) { 52 weak_ptr_factory_(this) {
53 pipe_fd_[0] = pipe_fd_[1] = -1; 53 pipe_fd_[0] = pipe_fd_[1] = -1;
54 } 54 }
55 55
56 virtual ~PipeReader() { 56 virtual ~PipeReader() {
57 // Don't close pipe_fd_[0] as it's closed by data_stream_. 57 // Don't close pipe_fd_[0] as it's closed by data_stream_.
58 if (pipe_fd_[1] != -1) 58 if (pipe_fd_[1] != -1)
59 if (HANDLE_EINTR(close(pipe_fd_[1])) < 0) 59 if (IGNORE_EINTR(close(pipe_fd_[1])) < 0)
60 PLOG(ERROR) << "close[1]"; 60 PLOG(ERROR) << "close[1]";
61 } 61 }
62 62
63 // Returns descriptor for the writeable side of the pipe. 63 // Returns descriptor for the writeable side of the pipe.
64 int GetWriteFD() { return pipe_fd_[1]; } 64 int GetWriteFD() { return pipe_fd_[1]; }
65 65
66 // Closes writeable descriptor; normally used in parent process after fork. 66 // Closes writeable descriptor; normally used in parent process after fork.
67 void CloseWriteFD() { 67 void CloseWriteFD() {
68 if (pipe_fd_[1] != -1) { 68 if (pipe_fd_[1] != -1) {
69 if (HANDLE_EINTR(close(pipe_fd_[1])) < 0) 69 if (IGNORE_EINTR(close(pipe_fd_[1])) < 0)
70 PLOG(ERROR) << "close"; 70 PLOG(ERROR) << "close";
71 pipe_fd_[1] = -1; 71 pipe_fd_[1] = -1;
72 } 72 }
73 } 73 }
74 74
75 // Returns collected data. 75 // Returns collected data.
76 std::string* data() { return &data_; } 76 std::string* data() { return &data_; }
77 77
78 // Starts data collection. Returns true if stream was setup correctly. 78 // Starts data collection. Returns true if stream was setup correctly.
79 // On success data will automatically be accumulated into a string that 79 // On success data will automatically be accumulated into a string that
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 DebugDaemonClient::EmptyStopSystemTracingCallback() { 631 DebugDaemonClient::EmptyStopSystemTracingCallback() {
632 return base::Bind(&EmptyStopSystemTracingCallbackBody); 632 return base::Bind(&EmptyStopSystemTracingCallbackBody);
633 } 633 }
634 634
635 // static 635 // static
636 DebugDaemonClient* DebugDaemonClient::Create() { 636 DebugDaemonClient* DebugDaemonClient::Create() {
637 return new DebugDaemonClientImpl(); 637 return new DebugDaemonClientImpl();
638 } 638 }
639 639
640 } // namespace chromeos 640 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_posix.cc ('k') | chromeos/process_proxy/process_output_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698