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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 9288030: Fix warning so Android ipc_tests builds again. (-Werror turned on in http://codereview.chromium.org… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months 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 | no next file » | 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 "ipc/ipc_channel_posix.h" 5 #include "ipc/ipc_channel_posix.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 return true; 961 return true;
962 #elif defined(OS_SOLARIS) 962 #elif defined(OS_SOLARIS)
963 return false; 963 return false;
964 #else 964 #else
965 struct ucred cred; 965 struct ucred cred;
966 socklen_t cred_len = sizeof(cred); 966 socklen_t cred_len = sizeof(cred);
967 if (getsockopt(pipe_, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len) != 0) { 967 if (getsockopt(pipe_, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len) != 0) {
968 PLOG(ERROR) << "getsockopt " << pipe_; 968 PLOG(ERROR) << "getsockopt " << pipe_;
969 return false; 969 return false;
970 } 970 }
971 if (cred_len < sizeof(cred)) { 971 if (static_cast<unsigned>(cred_len) < sizeof(cred)) {
972 NOTREACHED() << "Truncated ucred from SO_PEERCRED?"; 972 NOTREACHED() << "Truncated ucred from SO_PEERCRED?";
973 return false; 973 return false;
974 } 974 }
975 *client_euid = cred.uid; 975 *client_euid = cred.uid;
976 return true; 976 return true;
977 #endif 977 #endif
978 } 978 }
979 979
980 void Channel::ChannelImpl::ResetToAcceptingConnectionState() { 980 void Channel::ChannelImpl::ResetToAcceptingConnectionState() {
981 // Unregister libevent for the unix domain socket and close it. 981 // Unregister libevent for the unix domain socket and close it.
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 } 1253 }
1254 1254
1255 #if defined(OS_LINUX) 1255 #if defined(OS_LINUX)
1256 // static 1256 // static
1257 void Channel::SetGlobalPid(int pid) { 1257 void Channel::SetGlobalPid(int pid) {
1258 ChannelImpl::SetGlobalPid(pid); 1258 ChannelImpl::SetGlobalPid(pid);
1259 } 1259 }
1260 #endif // OS_LINUX 1260 #endif // OS_LINUX
1261 1261
1262 } // namespace IPC 1262 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698