summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-08-10 12:26:15 +0200
committerMax Kellermann <max@musicpd.org>2017-08-10 13:12:13 +0200
commit54de8b8e77c90a42aef8f0ef665caf42c0f1d1b6 (patch)
tree117c2d506d5aa0fb94e0b6187a33d88ef45d34ea
parent796956970e26e5ea1730d9f070014f592ab9c082 (diff)
net/*, ...: use AF_LOCAL instead of AF_UNIX
-rw-r--r--src/client/ClientNew.cxx2
-rw-r--r--src/net/AllocatedSocketAddress.cxx2
-rw-r--r--src/net/ToString.cxx2
-rw-r--r--src/output/plugins/httpd/HttpdOutputPlugin.cxx4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/client/ClientNew.cxx b/src/client/ClientNew.cxx
index 97a891e7a..772c5661b 100644
--- a/src/client/ClientNew.cxx
+++ b/src/client/ClientNew.cxx
@@ -65,7 +65,7 @@ client_new(EventLoop &loop, Partition &partition,
assert(fd >= 0);
#ifdef HAVE_LIBWRAP
- if (address.GetFamily() != AF_UNIX) {
+ if (address.GetFamily() != AF_LOCAL) {
// TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd";
diff --git a/src/net/AllocatedSocketAddress.cxx b/src/net/AllocatedSocketAddress.cxx
index 1174e14d1..bd4725692 100644
--- a/src/net/AllocatedSocketAddress.cxx
+++ b/src/net/AllocatedSocketAddress.cxx
@@ -82,7 +82,7 @@ AllocatedSocketAddress::SetLocal(const char *path) noexcept
struct sockaddr_un *sun;
SetSize(sizeof(*sun) - sizeof(sun->sun_path) + path_length);
sun = (struct sockaddr_un *)address;
- sun->sun_family = AF_UNIX;
+ sun->sun_family = AF_LOCAL;
memcpy(sun->sun_path, path, path_length);
if (is_abstract)
diff --git a/src/net/ToString.cxx b/src/net/ToString.cxx
index f185a5e2e..98f9f9b10 100644
--- a/src/net/ToString.cxx
+++ b/src/net/ToString.cxx
@@ -116,7 +116,7 @@ std::string
ToString(SocketAddress address) noexcept
{
#ifdef HAVE_UN
- if (address.GetFamily() == AF_UNIX)
+ if (address.GetFamily() == AF_LOCAL)
/* return path of UNIX domain sockets */
return LocalAddressToString(*(const sockaddr_un *)address.GetAddress(),
address.GetSize());
diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
index fa5d38ef0..07e5cb3fb 100644
--- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx
+++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
@@ -42,7 +42,7 @@
#include <errno.h>
#ifdef HAVE_LIBWRAP
-#include <sys/socket.h> /* needed for AF_UNIX */
+#include <sys/socket.h> /* needed for AF_LOCAL */
#include <tcpd.h>
#endif
@@ -157,7 +157,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid)
connected */
#ifdef HAVE_LIBWRAP
- if (address.GetFamily() != AF_UNIX) {
+ if (address.GetFamily() != AF_LOCAL) {
const auto hostaddr = ToString(address);
// TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd";