summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao2016-11-17 15:32:45 -0600
committerAndroid (Google) Code Review2016-11-17 15:32:45 -0600
commitda66b9100af805e2a4ce2d156364539cb873064a (patch)
treefb5fbf116714e545a7719ad996b046c5e32f3669
parentb19b5fe08cb3969a34b97653630561be15f3a5bc (diff)
parent58eda35acecda91ccbc90023de4f0c4a46beafd6 (diff)
downloadplatform-system-core-da66b9100af805e2a4ce2d156364539cb873064a.tar.gz
platform-system-core-da66b9100af805e2a4ce2d156364539cb873064a.tar.xz
platform-system-core-da66b9100af805e2a4ce2d156364539cb873064a.zip
Merge "adb: actually fix the windows build." into klp-dev
-rw-r--r--adb/sockets.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/adb/sockets.c b/adb/sockets.c
index da894c3f0..d4866817f 100644
--- a/adb/sockets.c
+++ b/adb/sockets.c
@@ -20,13 +20,17 @@
20#include <errno.h> 20#include <errno.h>
21#include <string.h> 21#include <string.h>
22#include <ctype.h> 22#include <ctype.h>
23#include <pthread.h>
24 23
25#include "sysdeps.h" 24#include "sysdeps.h"
26 25
27#define TRACE_TAG TRACE_SOCKETS 26#define TRACE_TAG TRACE_SOCKETS
28#include "adb.h" 27#include "adb.h"
29 28
29#if defined(_WIN32)
30#define pthread_mutex_lock(...) abort()
31#define pthread_mutex_unlock(...) abort()
32#else
33#include <pthread.h>
30static pthread_mutex_t socket_list_lock; 34static pthread_mutex_t socket_list_lock;
31static void __attribute__((constructor)) socket_list_lock_init(void) { 35static void __attribute__((constructor)) socket_list_lock_init(void) {
32 pthread_mutexattr_t attr; 36 pthread_mutexattr_t attr;
@@ -34,6 +38,7 @@ static void __attribute__((constructor)) socket_list_lock_init(void) {
34 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 38 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
35 pthread_mutex_init(&socket_list_lock, &attr); 39 pthread_mutex_init(&socket_list_lock, &attr);
36} 40}
41#endif
37 42
38int sendfailmsg(int fd, const char *reason) 43int sendfailmsg(int fd, const char *reason)
39{ 44{