Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2173e192 authored by Tom Cherry's avatar Tom Cherry Committed by android-build-merger
Browse files

Merge "init: log failures if a service cannot start during class_start" am:...

Merge "init: log failures if a service cannot start during class_start" am: 533fbd62 am: 5c008989 am: d1721a99
am: f85f4d6a

Change-Id: I7bd3cfb30127e5af6ce457d3c5691e876faf6de4
parents 1630ac8e f85f4d6a
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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();
}