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

Side by Side Diff: remoting/host/ipc_util_posix.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
« no previous file with comments | « printing/pdf_metafile_skia.cc ('k') | remoting/host/local_input_monitor_linux.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/host/ipc_util.h" 5 #include "remoting/host/ipc_util.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/socket.h> 8 #include <sys/socket.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 15 matching lines...) Expand all
26 int pipe_fds[2]; 26 int pipe_fds[2];
27 if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe_fds) != 0) { 27 if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe_fds) != 0) {
28 PLOG(ERROR) << "socketpair()"; 28 PLOG(ERROR) << "socketpair()";
29 return false; 29 return false;
30 } 30 }
31 31
32 // Set both ends to be non-blocking. 32 // Set both ends to be non-blocking.
33 if (fcntl(pipe_fds[0], F_SETFL, O_NONBLOCK) == -1 || 33 if (fcntl(pipe_fds[0], F_SETFL, O_NONBLOCK) == -1 ||
34 fcntl(pipe_fds[1], F_SETFL, O_NONBLOCK) == -1) { 34 fcntl(pipe_fds[1], F_SETFL, O_NONBLOCK) == -1) {
35 PLOG(ERROR) << "fcntl(O_NONBLOCK)"; 35 PLOG(ERROR) << "fcntl(O_NONBLOCK)";
36 if (HANDLE_EINTR(close(pipe_fds[0])) < 0) 36 if (IGNORE_EINTR(close(pipe_fds[0])) < 0)
37 PLOG(ERROR) << "close()"; 37 PLOG(ERROR) << "close()";
38 if (HANDLE_EINTR(close(pipe_fds[1])) < 0) 38 if (IGNORE_EINTR(close(pipe_fds[1])) < 0)
39 PLOG(ERROR) << "close()"; 39 PLOG(ERROR) << "close()";
40 return false; 40 return false;
41 } 41 }
42 42
43 std::string socket_name = "Chromoting socket"; 43 std::string socket_name = "Chromoting socket";
44 44
45 // Wrap the pipe into an IPC channel. 45 // Wrap the pipe into an IPC channel.
46 base::FileDescriptor fd(pipe_fds[0], false); 46 base::FileDescriptor fd(pipe_fds[0], false);
47 IPC::ChannelHandle handle(socket_name, fd); 47 IPC::ChannelHandle handle(socket_name, fd);
48 server_out->reset(new IPC::ChannelProxy(IPC::ChannelHandle(socket_name, fd), 48 server_out->reset(new IPC::ChannelProxy(IPC::ChannelHandle(socket_name, fd),
49 IPC::Channel::MODE_SERVER, 49 IPC::Channel::MODE_SERVER,
50 listener, 50 listener,
51 io_task_runner.get())); 51 io_task_runner.get()));
52 52
53 *client_out = base::FileDescriptor(pipe_fds[1], false); 53 *client_out = base::FileDescriptor(pipe_fds[1], false);
54 return true; 54 return true;
55 } 55 }
56 56
57 } // namespace remoting 57 } // namespace remoting
OLDNEW
« no previous file with comments | « printing/pdf_metafile_skia.cc ('k') | remoting/host/local_input_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698