OLD | NEW |
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 <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
11 #include <sys/un.h> | 11 #include <sys/un.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include "base/file_util.h" | |
15 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/files/file_util.h" |
16 #include "base/files/scoped_file.h" | 16 #include "base/files/scoped_file.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/posix/eintr_wrapper.h" | 18 #include "base/posix/eintr_wrapper.h" |
19 | 19 |
20 namespace IPC { | 20 namespace IPC { |
21 | 21 |
22 // Verify that kMaxSocketNameLength is a decent size. | 22 // Verify that kMaxSocketNameLength is a decent size. |
23 COMPILE_ASSERT(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxSocketNameLength, | 23 COMPILE_ASSERT(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxSocketNameLength, |
24 BAD_SUN_PATH_LENGTH); | 24 BAD_SUN_PATH_LENGTH); |
25 | 25 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // It's safe to keep listening on |server_listen_fd| even if the attempt to | 192 // It's safe to keep listening on |server_listen_fd| even if the attempt to |
193 // set O_NONBLOCK failed on the client fd. | 193 // set O_NONBLOCK failed on the client fd. |
194 return true; | 194 return true; |
195 } | 195 } |
196 | 196 |
197 *server_socket = accept_fd.release(); | 197 *server_socket = accept_fd.release(); |
198 return true; | 198 return true; |
199 } | 199 } |
200 | 200 |
201 } // namespace IPC | 201 } // namespace IPC |
OLD | NEW |