summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski2014-02-26 06:41:11 -0600
committerElliott Hughes2014-02-26 13:33:45 -0600
commita7e2e7634c4242a9ab2fa7c8031a5745beac613f (patch)
tree711bc5041e8df789e39f06024abef94f466944e2 /libcutils/socket_local_server.c
parentebb46d76e4bf4ee4f34b42709ea69cce07e3e322 (diff)
downloadplatform-system-core-a7e2e7634c4242a9ab2fa7c8031a5745beac613f.tar.gz
platform-system-core-a7e2e7634c4242a9ab2fa7c8031a5745beac613f.tar.xz
platform-system-core-a7e2e7634c4242a9ab2fa7c8031a5745beac613f.zip
libcutils: Socket type might contain bitwise OR flags
Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Change-Id: Ia5c8f136793a989fc1d71c61292afe4e5cf169fa
Diffstat (limited to 'libcutils/socket_local_server.c')
-rw-r--r--libcutils/socket_local_server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcutils/socket_local_server.c b/libcutils/socket_local_server.c
index 4971b1b1c..7628fe459 100644
--- a/libcutils/socket_local_server.c
+++ b/libcutils/socket_local_server.c
@@ -43,6 +43,8 @@ int socket_local_server(const char *name, int namespaceId, int type)
43 43
44#define LISTEN_BACKLOG 4 44#define LISTEN_BACKLOG 4
45 45
46/* Only the bottom bits are really the socket type; there are flags too. */
47#define SOCK_TYPE_MASK 0xf
46 48
47/** 49/**
48 * Binds a pre-created socket(AF_LOCAL) 's' to 'name' 50 * Binds a pre-created socket(AF_LOCAL) 's' to 'name'
@@ -107,7 +109,7 @@ int socket_local_server(const char *name, int namespace, int type)
107 return -1; 109 return -1;
108 } 110 }
109 111
110 if (type == SOCK_STREAM) { 112 if ((type & SOCK_TYPE_MASK) == SOCK_STREAM) {
111 int ret; 113 int ret;
112 114
113 ret = listen(s, LISTEN_BACKLOG); 115 ret = listen(s, LISTEN_BACKLOG);