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

Side by Side Diff: ipc/unix_domain_socket_util.cc

Issue 1546533002: Switch to standard integer types in ipc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « ipc/unix_domain_socket_util.h ('k') | ipc/unix_domain_socket_util_unittest.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 "ipc/unix_domain_socket_util.h" 5 #include "ipc/unix_domain_socket_util.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 <sys/socket.h> 10 #include <sys/socket.h>
10 #include <sys/stat.h> 11 #include <sys/stat.h>
11 #include <sys/un.h> 12 #include <sys/un.h>
12 #include <unistd.h> 13 #include <unistd.h>
13 14
14 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
15 #include "base/files/file_util.h" 16 #include "base/files/file_util.h"
16 #include "base/files/scoped_file.h" 17 #include "base/files/scoped_file.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/posix/eintr_wrapper.h" 19 #include "base/posix/eintr_wrapper.h"
20 #include "build/build_config.h"
19 21
20 namespace IPC { 22 namespace IPC {
21 23
22 // Verify that kMaxSocketNameLength is a decent size. 24 // Verify that kMaxSocketNameLength is a decent size.
23 static_assert(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxSocketNameLength, 25 static_assert(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxSocketNameLength,
24 "sun_path is too long."); 26 "sun_path is too long.");
25 27
26 namespace { 28 namespace {
27 29
28 // Returns fd (>= 0) on success, -1 on failure. If successful, fills in 30 // Returns fd (>= 0) on success, -1 on failure. If successful, fills in
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // It's safe to keep listening on |server_listen_fd| even if the attempt to 194 // It's safe to keep listening on |server_listen_fd| even if the attempt to
193 // set O_NONBLOCK failed on the client fd. 195 // set O_NONBLOCK failed on the client fd.
194 return true; 196 return true;
195 } 197 }
196 198
197 *server_socket = accept_fd.release(); 199 *server_socket = accept_fd.release();
198 return true; 200 return true;
199 } 201 }
200 202
201 } // namespace IPC 203 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/unix_domain_socket_util.h ('k') | ipc/unix_domain_socket_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698