From a4a37d7a196903d73180081159886de214b95849 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 21 Jul 2015 14:42:46 +0200 Subject: net/StaticSocketAddress: remove unused method SetLocal() --- src/net/StaticSocketAddress.cxx | 29 ----------------------------- src/net/StaticSocketAddress.hxx | 8 -------- 2 files changed, 37 deletions(-) (limited to 'src/net') diff --git a/src/net/StaticSocketAddress.cxx b/src/net/StaticSocketAddress.cxx index 20dd175c6..27de7f6f5 100644 --- a/src/net/StaticSocketAddress.cxx +++ b/src/net/StaticSocketAddress.cxx @@ -32,16 +32,8 @@ #include -#include #include -#ifdef WIN32 -#include -#else -#include -#include -#endif - StaticSocketAddress & StaticSocketAddress::operator=(SocketAddress other) { @@ -56,24 +48,3 @@ StaticSocketAddress::operator==(const StaticSocketAddress &other) const return size == other.size && memcmp(&address, &other.address, size) == 0; } - -#if defined(HAVE_UN) && !defined(__BIONIC__) - -void -StaticSocketAddress::SetLocal(const char *path) -{ - auto &sun = reinterpret_cast(address); - - const size_t path_length = strlen(path); - - // TODO: make this a runtime check - assert(path_length < sizeof(sun.sun_path)); - - sun.sun_family = AF_LOCAL; - memcpy(sun.sun_path, path, path_length + 1); - - /* note: Bionic doesn't provide SUN_LEN() */ - size = SUN_LEN(&sun); -} - -#endif diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx index c91231138..2d92d36b5 100644 --- a/src/net/StaticSocketAddress.hxx +++ b/src/net/StaticSocketAddress.hxx @@ -31,7 +31,6 @@ #define STATIC_SOCKET_ADDRESS_HXX #include "SocketAddress.hxx" -#include "Features.hxx" #include "Compiler.h" #include @@ -57,13 +56,6 @@ public: size); } -#if defined(HAVE_UN) && !defined(__BIONIC__) - /** - * Make this a "local" address (UNIX domain socket). - */ - void SetLocal(const char *path); -#endif - operator struct sockaddr *() { return reinterpret_cast(&address); } -- cgit v1.2.3