summaryrefslogtreecommitdiffstats
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-10-03 22:03:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-10-03 22:03:33 +0000
commit533fbd62ab72970c7170117d37a03d846e44c9ea (patch)
treee091b81cd830b2862b9e0dbf68e96b4cefc2684b /init/builtins.cpp
parent2364d7ccc5a19def8a97bb21de764f3084fd9fef (diff)
parent20acdef8164d77b99f8abede198a03ac510a7a08 (diff)
downloadsystem_core-533fbd62ab72970c7170117d37a03d846e44c9ea.tar.gz
system_core-533fbd62ab72970c7170117d37a03d846e44c9ea.tar.bz2
system_core-533fbd62ab72970c7170117d37a03d846e44c9ea.zip
Merge "init: log failures if a service cannot start during class_start"
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 60c0007c0..027b392fd 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -99,7 +99,14 @@ static void ForEachServiceInClass(const std::string& classname, F function) {
static Result<Success> do_class_start(const BuiltinArguments& args) {
// Starting a class does not start services which are explicitly disabled.
// They must be started individually.
- ForEachServiceInClass(args[1], &Service::StartIfNotDisabled);
+ for (const auto& service : ServiceList::GetInstance()) {
+ if (service->classnames().count(args[1])) {
+ if (auto result = service->StartIfNotDisabled(); !result) {
+ LOG(ERROR) << "Could not start service '" << service->name()
+ << "' as part of class '" << args[1] << "': " << result.error();
+ }
+ }
+ }
return Success();
}