]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Extract port binding code to a function and improve output.
[user/henk/code/inspircd.git] / src / configreader.cpp
index 2a1da8fd8fbb23dac1c699c39a8d3968f5a64692..0f2063a6088521c7fe2a0fa6843bd886daea651b 100644 (file)
@@ -510,13 +510,12 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
                ServerInstance->BindPorts(pl);
                if (pl.size())
                {
-                       errstr << "Not all your client ports could be bound." << std::endl
-                               << "The following port(s) failed to bind:" << std::endl;
-
-                       int j = 1;
-                       for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
+                       std::cout << "Warning! Some of your listener" << (pl.size() == 1 ? "s" : "") << " failed to bind:" << std::endl;
+                       for (FailedPortList::const_iterator iter = pl.begin(); iter != pl.end(); ++iter)
                        {
-                               errstr << j << ".\tAddress: " << i->first.str() << "\tReason: " << strerror(i->second) << std::endl;
+                               const FailedPort& fp = *iter;
+                               errstr << "  " << fp.sa.str() << ": " << strerror(fp.error) << std::endl
+                                       << "  " << "Created from <bind> tag at " << fp.tag->getTagLocation() << std::endl;
                        }
                }
        }