diff options
author | Tom Cherry <tomcherry@google.com> | 2017-10-03 22:42:51 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-03 22:42:51 +0000 |
commit | 5c00898944e469e637acd8a092c21b0f823689ac (patch) | |
tree | 9bd65d7f06af8944ba41b85e92dbb251b593e4ee /init/builtins.cpp | |
parent | 510552149c84abecf0a2bc7d0aba8e26b8af77b6 (diff) | |
parent | 533fbd62ab72970c7170117d37a03d846e44c9ea (diff) | |
download | system_core-5c00898944e469e637acd8a092c21b0f823689ac.tar.gz system_core-5c00898944e469e637acd8a092c21b0f823689ac.tar.bz2 system_core-5c00898944e469e637acd8a092c21b0f823689ac.zip |
Merge "init: log failures if a service cannot start during class_start"
am: 533fbd62ab
Change-Id: I7a05ae9f806a23d04d649fb230e2875633b2caee
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 4c2dc9adb..9be274b56 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(); } |