summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao2016-11-15 14:58:44 -0600
committerJosh Gao2016-11-15 15:05:11 -0600
commit58eda35acecda91ccbc90023de4f0c4a46beafd6 (patch)
tree6320ef80fe9a17779a020ff33bba9732ce6ef696
parenta9c0ac0c465e14a0b7593b5f22c13dc98480ca6d (diff)
downloadplatform-system-core-58eda35acecda91ccbc90023de4f0c4a46beafd6.tar.gz
platform-system-core-58eda35acecda91ccbc90023de4f0c4a46beafd6.tar.xz
platform-system-core-58eda35acecda91ccbc90023de4f0c4a46beafd6.zip
adb: actually fix the windows build.
Bug: http://b/32292581 Change-Id: I714e1f47c2c2e89027989d485cb28891b905f931
-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{