am 431735f0: Merge "libcutils: Socket type might contain bitwise OR flags"
* commit '431735f005af79407e01a68995ac6dde7ff4b815': libcutils: Socket type might contain bitwise OR flags
This commit is contained in:
commit
8828994d05
1 changed files with 3 additions and 1 deletions
|
|
@ -43,6 +43,8 @@ int socket_local_server(const char *name, int namespaceId, int type)
|
||||||
|
|
||||||
#define LISTEN_BACKLOG 4
|
#define LISTEN_BACKLOG 4
|
||||||
|
|
||||||
|
/* Only the bottom bits are really the socket type; there are flags too. */
|
||||||
|
#define SOCK_TYPE_MASK 0xf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a pre-created socket(AF_LOCAL) 's' to 'name'
|
* 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)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == SOCK_STREAM) {
|
if ((type & SOCK_TYPE_MASK) == SOCK_STREAM) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = listen(s, LISTEN_BACKLOG);
|
ret = listen(s, LISTEN_BACKLOG);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue