From c65fbcb5717a6fc0177e93838450e0d4b79bcf60 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 27 Apr 2023 11:52:26 +0100 Subject: Use the correct socket error messages on Windows. --- src/socket.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/socket.cpp') diff --git a/src/socket.cpp b/src/socket.cpp index 484dcf81d..d3dea3c72 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -55,7 +55,7 @@ bool InspIRCd::BindPort(const std::shared_ptr& tag, const irc::socket if (!ll->HasFd()) { ServerInstance->Logs.Normal("SOCKET", "Failed to listen on {} from tag at {}: {}", - sa.str(), tag->source.str(), strerror(errno)); + sa.str(), tag->source.str(), SocketEngine::LastError()); delete ll; return false; } @@ -152,7 +152,7 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) for (const auto protocol : protocols) { if (!BindPort(tag, bindspec, old_ports, protocol)) - failed_ports.emplace_back(strerror(errno), bindspec, tag); + failed_ports.emplace_back(SocketEngine::LastError(), bindspec, tag); else bound++; } @@ -184,7 +184,7 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) bindspec.from_unix(fullpath); if (!BindPort(tag, bindspec, old_ports, 0)) - failed_ports.emplace_back(strerror(errno), bindspec, tag); + failed_ports.emplace_back(SocketEngine::LastError(), bindspec, tag); else bound++; } -- cgit v1.3.1-10-gc9f91