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

Side by Side Diff: base/posix/unix_domain_socket.cc

Issue 11573030: Revert 173064 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « no previous file | sandbox/linux/sandbox_linux.gypi » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/posix/unix_domain_socket.h" 5 #include "base/posix/unix_domain_socket.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 #include <sys/uio.h> 9 #include <sys/uio.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 25 matching lines...) Expand all
36 msg.msg_control = control_buffer; 36 msg.msg_control = control_buffer;
37 msg.msg_controllen = control_len; 37 msg.msg_controllen = control_len;
38 cmsg = CMSG_FIRSTHDR(&msg); 38 cmsg = CMSG_FIRSTHDR(&msg);
39 cmsg->cmsg_level = SOL_SOCKET; 39 cmsg->cmsg_level = SOL_SOCKET;
40 cmsg->cmsg_type = SCM_RIGHTS; 40 cmsg->cmsg_type = SCM_RIGHTS;
41 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fds.size()); 41 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fds.size());
42 memcpy(CMSG_DATA(cmsg), &fds[0], sizeof(int) * fds.size()); 42 memcpy(CMSG_DATA(cmsg), &fds[0], sizeof(int) * fds.size());
43 msg.msg_controllen = cmsg->cmsg_len; 43 msg.msg_controllen = cmsg->cmsg_len;
44 } 44 }
45 45
46 const ssize_t r = HANDLE_EINTR(sendmsg(fd, &msg, MSG_NOSIGNAL)); 46 const ssize_t r = HANDLE_EINTR(sendmsg(fd, &msg, 0));
47 const bool ret = static_cast<ssize_t>(length) == r; 47 const bool ret = static_cast<ssize_t>(length) == r;
48 delete[] control_buffer; 48 delete[] control_buffer;
49 return ret; 49 return ret;
50 } 50 }
51 51
52 // static 52 // static
53 ssize_t UnixDomainSocket::RecvMsg(int fd, 53 ssize_t UnixDomainSocket::RecvMsg(int fd,
54 void* buf, 54 void* buf,
55 size_t length, 55 size_t length,
56 std::vector<int>* fds) { 56 std::vector<int>* fds) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 NOTREACHED(); 137 NOTREACHED();
138 138
139 return -1; 139 return -1;
140 } 140 }
141 141
142 if (result_fd) 142 if (result_fd)
143 *result_fd = fd_vector.empty() ? -1 : fd_vector[0]; 143 *result_fd = fd_vector.empty() ? -1 : fd_vector[0];
144 144
145 return reply_len; 145 return reply_len;
146 } 146 }
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698