diff options
author | Josh Gao | 2016-11-17 15:51:26 -0600 |
---|---|---|
committer | android-build-merger | 2016-11-17 15:51:26 -0600 |
commit | 1ceca95f8e4adf555307a57719338272f622a090 (patch) | |
tree | 38e406c9d120d5a9e09635c25369db8ba5e2d5c9 | |
parent | 85b6b131753ba55e6fb4de95f15921742350f74d (diff) | |
parent | bbd6d7b3e708e8e39ca7fe7f79b1cd2e4a074cc1 (diff) | |
download | platform-system-core-1ceca95f8e4adf555307a57719338272f622a090.tar.gz platform-system-core-1ceca95f8e4adf555307a57719338272f622a090.tar.xz platform-system-core-1ceca95f8e4adf555307a57719338272f622a090.zip |
adb: actually fix the windows build. am: 58eda35ace
am: bbd6d7b3e7
Change-Id: I0d2553e19b3e96e9af4e0aa3493a4b8b36e55431
-rw-r--r-- | adb/sockets.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/adb/sockets.c b/adb/sockets.c index bc8fffaac..7975adbec 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> | ||
30 | static pthread_mutex_t socket_list_lock; | 34 | static pthread_mutex_t socket_list_lock; |
31 | static void __attribute__((constructor)) socket_list_lock_init(void) { | 35 | static 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 | ||
38 | int sendfailmsg(int fd, const char *reason) | 43 | int sendfailmsg(int fd, const char *reason) |
39 | { | 44 | { |