Merge "Kill LOCAL_SOCKET_NAMESPACE."
This commit is contained in:
commit
eda16b98dc
3 changed files with 7 additions and 7 deletions
|
|
@ -52,7 +52,7 @@ int socket_make_sockaddr_un(const char *name, int namespaceId,
|
||||||
|
|
||||||
switch (namespaceId) {
|
switch (namespaceId) {
|
||||||
case ANDROID_SOCKET_NAMESPACE_ABSTRACT:
|
case ANDROID_SOCKET_NAMESPACE_ABSTRACT:
|
||||||
#ifdef HAVE_LINUX_LOCAL_SOCKET_NAMESPACE
|
#if defined(__linux__)
|
||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
|
|
||||||
// Test with length +1 for the *initial* '\0'.
|
// Test with length +1 for the *initial* '\0'.
|
||||||
|
|
@ -67,7 +67,7 @@ int socket_make_sockaddr_un(const char *name, int namespaceId,
|
||||||
|
|
||||||
p_addr->sun_path[0] = 0;
|
p_addr->sun_path[0] = 0;
|
||||||
memcpy(p_addr->sun_path + 1, name, namelen);
|
memcpy(p_addr->sun_path + 1, name, namelen);
|
||||||
#else /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/
|
#else
|
||||||
/* this OS doesn't have the Linux abstract namespace */
|
/* this OS doesn't have the Linux abstract namespace */
|
||||||
|
|
||||||
namelen = strlen(name) + strlen(FILESYSTEM_SOCKET_PREFIX);
|
namelen = strlen(name) + strlen(FILESYSTEM_SOCKET_PREFIX);
|
||||||
|
|
@ -79,7 +79,7 @@ int socket_make_sockaddr_un(const char *name, int namespaceId,
|
||||||
|
|
||||||
strcpy(p_addr->sun_path, FILESYSTEM_SOCKET_PREFIX);
|
strcpy(p_addr->sun_path, FILESYSTEM_SOCKET_PREFIX);
|
||||||
strcat(p_addr->sun_path, name);
|
strcat(p_addr->sun_path, name);
|
||||||
#endif /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANDROID_SOCKET_NAMESPACE_RESERVED:
|
case ANDROID_SOCKET_NAMESPACE_RESERVED:
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ int socket_local_server_bind(int s, const char *name, int namespaceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* basically: if this is a filesystem path, unlink first */
|
/* basically: if this is a filesystem path, unlink first */
|
||||||
#ifndef HAVE_LINUX_LOCAL_SOCKET_NAMESPACE
|
#if !defined(__linux__)
|
||||||
if (1) {
|
if (1) {
|
||||||
#else
|
#else
|
||||||
if (namespaceId == ANDROID_SOCKET_NAMESPACE_RESERVED
|
if (namespaceId == ANDROID_SOCKET_NAMESPACE_RESERVED
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ int WEAK socket_make_sockaddr_un(const char *name, int namespaceId,
|
||||||
|
|
||||||
switch (namespaceId) {
|
switch (namespaceId) {
|
||||||
case ANDROID_SOCKET_NAMESPACE_ABSTRACT:
|
case ANDROID_SOCKET_NAMESPACE_ABSTRACT:
|
||||||
#ifdef HAVE_LINUX_LOCAL_SOCKET_NAMESPACE
|
#if defined(__linux__)
|
||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
|
|
||||||
/* Test with length +1 for the *initial* '\0'. */
|
/* Test with length +1 for the *initial* '\0'. */
|
||||||
|
|
@ -87,7 +87,7 @@ int WEAK socket_make_sockaddr_un(const char *name, int namespaceId,
|
||||||
|
|
||||||
p_addr->sun_path[0] = 0;
|
p_addr->sun_path[0] = 0;
|
||||||
memcpy(p_addr->sun_path + 1, name, namelen);
|
memcpy(p_addr->sun_path + 1, name, namelen);
|
||||||
#else /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/
|
#else
|
||||||
/* this OS doesn't have the Linux abstract namespace */
|
/* this OS doesn't have the Linux abstract namespace */
|
||||||
|
|
||||||
namelen = strlen(name) + strlen(FILESYSTEM_SOCKET_PREFIX);
|
namelen = strlen(name) + strlen(FILESYSTEM_SOCKET_PREFIX);
|
||||||
|
|
@ -99,7 +99,7 @@ int WEAK socket_make_sockaddr_un(const char *name, int namespaceId,
|
||||||
|
|
||||||
strcpy(p_addr->sun_path, FILESYSTEM_SOCKET_PREFIX);
|
strcpy(p_addr->sun_path, FILESYSTEM_SOCKET_PREFIX);
|
||||||
strcat(p_addr->sun_path, name);
|
strcat(p_addr->sun_path, name);
|
||||||
#endif /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANDROID_SOCKET_NAMESPACE_RESERVED:
|
case ANDROID_SOCKET_NAMESPACE_RESERVED:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue