summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-05-29 12:48:05 +0100
committerPeter Powell <petpow@saberuk.com>2019-05-29 17:50:49 +0100
commit33932b95e4b886aec8ac1bf3e3e1665826bcd0ea (patch)
tree99f7a15ae6c73753c2a330aa1e54128de3cf99a1 /src/modules
parentde7011e54ad88656e01c92a88dd053a94b5acc6b (diff)
Add irc::sockets::isunix for checking if a file is a UNIX socket.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/main.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 44271473c..55fe992b6 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -191,11 +191,9 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
}
irc::sockets::sockaddrs sa;
-#ifndef _WIN32
if (x->IPAddr.find('/') != std::string::npos)
{
- struct stat sb;
- if (stat(x->IPAddr.c_str(), &sb) == -1 || !S_ISSOCK(sb.st_mode) || !irc::sockets::untosa(x->IPAddr, sa))
+ if (!irc::sockets::isunix(x->IPAddr) || !irc::sockets::untosa(x->IPAddr, sa))
{
// We don't use the family() != AF_UNSPEC check below for UNIX sockets as
// that results in a DNS lookup.
@@ -205,7 +203,6 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
}
}
else
-#endif
{
// If this fails then the IP sa will be AF_UNSPEC.
irc::sockets::aptosa(x->IPAddr, x->Port, sa);