From 9768d24fa096e312e472a43e13cf2867c1bf581d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 21 Nov 2014 22:50:20 -0800 Subject: [PATCH] Kill LOCAL_SOCKET_NAMESPACE. Change-Id: I18928f89f66c37be310c45ff4c05a6d47ab84f66 --- libcutils/socket_local_client.c | 6 +++--- libcutils/socket_local_server.c | 2 +- liblog/log_read.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libcutils/socket_local_client.c b/libcutils/socket_local_client.c index ddcc2da4e..7b42daaee 100644 --- a/libcutils/socket_local_client.c +++ b/libcutils/socket_local_client.c @@ -52,7 +52,7 @@ int socket_make_sockaddr_un(const char *name, int namespaceId, switch (namespaceId) { case ANDROID_SOCKET_NAMESPACE_ABSTRACT: -#ifdef HAVE_LINUX_LOCAL_SOCKET_NAMESPACE +#if defined(__linux__) namelen = strlen(name); // 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; memcpy(p_addr->sun_path + 1, name, namelen); -#else /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/ +#else /* this OS doesn't have the Linux abstract namespace */ 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); strcat(p_addr->sun_path, name); -#endif /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/ +#endif break; case ANDROID_SOCKET_NAMESPACE_RESERVED: diff --git a/libcutils/socket_local_server.c b/libcutils/socket_local_server.c index 7628fe459..60eb86b83 100644 --- a/libcutils/socket_local_server.c +++ b/libcutils/socket_local_server.c @@ -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 */ -#ifndef HAVE_LINUX_LOCAL_SOCKET_NAMESPACE +#if !defined(__linux__) if (1) { #else if (namespaceId == ANDROID_SOCKET_NAMESPACE_RESERVED diff --git a/liblog/log_read.c b/liblog/log_read.c index ca5a1a7fa..2f21a5d9b 100644 --- a/liblog/log_read.c +++ b/liblog/log_read.c @@ -72,7 +72,7 @@ int WEAK socket_make_sockaddr_un(const char *name, int namespaceId, switch (namespaceId) { case ANDROID_SOCKET_NAMESPACE_ABSTRACT: -#ifdef HAVE_LINUX_LOCAL_SOCKET_NAMESPACE +#if defined(__linux__) namelen = strlen(name); /* 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; memcpy(p_addr->sun_path + 1, name, namelen); -#else /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/ +#else /* this OS doesn't have the Linux abstract namespace */ 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); strcat(p_addr->sun_path, name); -#endif /*HAVE_LINUX_LOCAL_SOCKET_NAMESPACE*/ +#endif break; case ANDROID_SOCKET_NAMESPACE_RESERVED: