OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "tools/android/common/adb_connection.h" | 5 #include "tools/android/common/adb_connection.h" |
6 | 6 |
7 #include <arpa/inet.h> | 7 #include <arpa/inet.h> |
8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <stddef.h> |
9 #include <stdio.h> | 10 #include <stdio.h> |
10 #include <stdlib.h> | 11 #include <stdlib.h> |
| 12 #include <string.h> |
11 #include <sys/socket.h> | 13 #include <sys/socket.h> |
12 #include <sys/types.h> | 14 #include <sys/types.h> |
13 #include <unistd.h> | 15 #include <unistd.h> |
14 | 16 |
15 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" |
16 #include "base/posix/eintr_wrapper.h" | 19 #include "base/posix/eintr_wrapper.h" |
17 #include "tools/android/common/net.h" | 20 #include "tools/android/common/net.h" |
18 | 21 |
19 namespace tools { | 22 namespace tools { |
20 namespace { | 23 namespace { |
21 | 24 |
22 void CloseSocket(int fd) { | 25 void CloseSocket(int fd) { |
23 if (fd >= 0) { | 26 if (fd >= 0) { |
24 int old_errno = errno; | 27 int old_errno = errno; |
25 close(fd); | 28 close(fd); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 LOG(ERROR) << "Bad response from ADB: length: " << response_length | 100 LOG(ERROR) << "Bad response from ADB: length: " << response_length |
98 << " data: " << DumpBinary(response, response_length); | 101 << " data: " << DumpBinary(response, response_length); |
99 CloseSocket(host_socket); | 102 CloseSocket(host_socket); |
100 return -1; | 103 return -1; |
101 } | 104 } |
102 | 105 |
103 return host_socket; | 106 return host_socket; |
104 } | 107 } |
105 | 108 |
106 } // namespace tools | 109 } // namespace tools |
OLD | NEW |