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

Side by Side Diff: tools/android/forwarder2/pipe_notifier.cc

Issue 11366229: Move eintr_wrapper.h from base to base/posix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « tools/android/forwarder2/host_forwarder_main.cc ('k') | tools/android/forwarder2/socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "tools/android/forwarder2/pipe_notifier.h" 5 #include "tools/android/forwarder2/pipe_notifier.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
11 11
12 #include "base/eintr_wrapper.h"
13 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/posix/eintr_wrapper.h"
14 #include "base/safe_strerror_posix.h" 14 #include "base/safe_strerror_posix.h"
15 15
16 namespace forwarder2 { 16 namespace forwarder2 {
17 17
18 PipeNotifier::PipeNotifier() { 18 PipeNotifier::PipeNotifier() {
19 int pipe_fd[2]; 19 int pipe_fd[2];
20 int ret = pipe(pipe_fd); 20 int ret = pipe(pipe_fd);
21 CHECK_EQ(0, ret); 21 CHECK_EQ(0, ret);
22 receiver_fd_ = pipe_fd[0]; 22 receiver_fd_ = pipe_fd[0];
23 sender_fd_ = pipe_fd[1]; 23 sender_fd_ = pipe_fd[1];
(...skipping 10 matching lines...) Expand all
34 errno = 0; 34 errno = 0;
35 int ret = HANDLE_EINTR(write(sender_fd_, "1", 1)); 35 int ret = HANDLE_EINTR(write(sender_fd_, "1", 1));
36 if (ret < 0) { 36 if (ret < 0) {
37 LOG(WARNING) << "Error while notifying pipe. " << safe_strerror(errno); 37 LOG(WARNING) << "Error while notifying pipe. " << safe_strerror(errno);
38 return false; 38 return false;
39 } 39 }
40 return true; 40 return true;
41 } 41 }
42 42
43 } // namespace forwarder 43 } // namespace forwarder
OLDNEW
« no previous file with comments | « tools/android/forwarder2/host_forwarder_main.cc ('k') | tools/android/forwarder2/socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698