From: Aki Tuomi Date: Sun, 14 Jul 2013 14:32:36 +0000 (+0300) Subject: Now sorts includes, fixes #913 X-Git-Tag: rec-3.6.0-rc1~559^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2dfec51844108c8b2bf2a453af3092dc2e03ec05;p=thirdparty%2Fpdns.git Now sorts includes, fixes #913 --- diff --git a/pdns/arguments.cc b/pdns/arguments.cc index da481a1b2e..b22a9ba735 100644 --- a/pdns/arguments.cc +++ b/pdns/arguments.cc @@ -17,6 +17,7 @@ */ #include "arguments.hh" #include +#include #include #include #include "namespaces.hh" @@ -473,7 +474,8 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) L << Logger::Error << params["include-dir"] << " is not accessible" << std::endl; throw ArgException(params["include-dir"] + " is not accessible"); } - + + std::list extraConfigs; while((ent = readdir(dir)) != NULL) { if (ent->d_name[0] == '.') continue; // skip any dots if (boost::ends_with(ent->d_name, ".conf")) { @@ -483,10 +485,17 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) L << Logger::Error << namebuf << " is not a file" << std::endl; throw ArgException(std::string(namebuf) + " does not exist!"); } - if (!file(namebuf, lax, true)) - L << Logger::Warning << namebuf << " could not be read - skipping" << std::endl; + extraConfigs.push_back(std::string(namebuf)); } } + extraConfigs.sort(); + BOOST_FOREACH(const std::string& fn, extraConfigs) { + std::cout << "parsing " << fn << std::endl; + if (!file(fn.c_str(), lax, true)) { + L << Logger::Error << namebuf << " could not be parsed" << std::endl; + throw ArgException(fn + " could not be parsed"); + } + } } return true;