From 612e1a30274bf4e239077f63a877440eb134da4d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 16 Jan 2023 22:54:02 +0000 Subject: Store the actual error in FailedPort instead of an error code. --- src/configreader.cpp | 2 +- src/inspircd.cpp | 2 +- src/socket.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/configreader.cpp b/src/configreader.cpp index 7556aab97..baa109d05 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -434,7 +434,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string& useruid) errstr << "Warning! Some of your listener" << (pl.size() == 1 ? "s" : "") << " failed to bind:" << std::endl; for (const auto& fp : pl) { - errstr << " " << fp.sa.str() << ": " << strerror(fp.error) << std::endl + errstr << " " << fp.sa.str() << ": " << fp.error << std::endl << " " << "Created from tag at " << fp.tag->source.str() << std::endl; } } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 7774965fc..e7b6257bd 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -378,7 +378,7 @@ namespace for (const auto& fp : pl) { - std::cout << " " << rang::style::bold << fp.sa.str() << rang::style::reset << ": " << strerror(fp.error) << '.' << std::endl + std::cout << " " << rang::style::bold << fp.sa.str() << rang::style::reset << ": " << fp.error << '.' << std::endl << " " << "Created from tag at " << fp.tag->source.str() << std::endl << std::endl; } diff --git a/src/socket.cpp b/src/socket.cpp index 05b94de8b..171f7368a 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -108,7 +108,7 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) continue; if (!BindPort(tag, bindspec, old_ports, protocol)) - failed_ports.emplace_back(errno, bindspec, tag); + failed_ports.emplace_back(strerror(errno), bindspec, tag); else bound++; } @@ -141,7 +141,7 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) bindspec.from_unix(fullpath); if (!BindPort(tag, bindspec, old_ports, 0)) - failed_ports.emplace_back(errno, bindspec, tag); + failed_ports.emplace_back(strerror(errno), bindspec, tag); else bound++; } -- cgit v1.3.1-10-gc9f91