From: Davin McCall Date: Sun, 17 Nov 2019 18:39:20 +0000 (+0000) Subject: dinitcheck: fix checking of dependencies X-Git-Tag: v0.8.0~33 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9b9a1e944ed153b7c49b3eca7608366d9570a26c;p=oweals%2Fdinit.git dinitcheck: fix checking of dependencies --- diff --git a/src/dinitcheck.cc b/src/dinitcheck.cc index 7fb74f7..37507dd 100644 --- a/src/dinitcheck.cc +++ b/src/dinitcheck.cc @@ -101,7 +101,9 @@ int main(int argc, char **argv) // TODO additional: check chain-to, other lint - for (const auto &name : services_to_check) { + for (size_t i = 0; i < services_to_check.size(); ++i) { + const std::string &name = services_to_check[i]; + std::cout << "Checking service: " << name << "...\n"; try { service_record *sr = load_service(service_set, name, service_dir_opts.get_paths()); service_set[name] = sr; @@ -122,6 +124,11 @@ int main(int argc, char **argv) return 0; } +static void report_unknown_setting_error(const std::string &service_name, const char *setting_name) +{ + std::cerr << "Service '" << service_name << "', unknown setting: " << setting_name << "\n"; +} + static void report_error(dinit_load::setting_exception &exc, const std::string &service_name, const char *setting_name) { std::cerr << "Service '" << service_name << "', " << setting_name << ": " << exc.get_info() << "\n"; @@ -505,7 +512,7 @@ service_record *load_service(service_set_t &services, const std::string &name, #endif } else { - throw service_description_exc(name, "Unknown setting: " + setting); + report_unknown_setting_error(name, setting.c_str()); } } catch (setting_exception &exc) {