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 <errno.h> | 5 #include <errno.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
8 #include <netinet/tcp.h> | 8 #include <netinet/tcp.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <signal.h> | 10 #include <signal.h> |
| 11 #include <stddef.h> |
11 #include <stdio.h> | 12 #include <stdio.h> |
12 #include <stdlib.h> | 13 #include <stdlib.h> |
13 #include <string.h> | 14 #include <string.h> |
14 #include <sys/select.h> | 15 #include <sys/select.h> |
15 #include <sys/socket.h> | 16 #include <sys/socket.h> |
16 #include <sys/wait.h> | 17 #include <sys/wait.h> |
17 #include <unistd.h> | 18 #include <unistd.h> |
18 | 19 |
19 #include "base/command_line.h" | 20 #include "base/command_line.h" |
20 #include "base/logging.h" | 21 #include "base/logging.h" |
| 22 #include "base/macros.h" |
21 #include "base/posix/eintr_wrapper.h" | 23 #include "base/posix/eintr_wrapper.h" |
22 #include "tools/android/common/adb_connection.h" | 24 #include "tools/android/common/adb_connection.h" |
23 #include "tools/android/common/daemon.h" | 25 #include "tools/android/common/daemon.h" |
24 #include "tools/android/common/net.h" | 26 #include "tools/android/common/net.h" |
25 | 27 |
26 namespace { | 28 namespace { |
27 | 29 |
28 const pthread_t kInvalidThread = static_cast<pthread_t>(-1); | 30 const pthread_t kInvalidThread = static_cast<pthread_t>(-1); |
29 volatile bool g_killed = false; | 31 volatile bool g_killed = false; |
30 | 32 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 for (int i = 0; i < g_server_count; i++) | 419 for (int i = 0; i < g_server_count; i++) |
418 g_servers[i].StartThread(); | 420 g_servers[i].StartThread(); |
419 for (int i = 0; i < g_server_count; i++) | 421 for (int i = 0; i < g_server_count; i++) |
420 g_servers[i].JoinThread(); | 422 g_servers[i].JoinThread(); |
421 g_server_count = 0; | 423 g_server_count = 0; |
422 delete [] g_servers; | 424 delete [] g_servers; |
423 | 425 |
424 return 0; | 426 return 0; |
425 } | 427 } |
426 | 428 |
OLD | NEW |