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

Commit d6b65fb3 authored by Jooyung Han's avatar Jooyung Han
Browse files

init: reset errno in do_start

do_start() ignores ENOENT intentionally to avoid logspam. It's
implemented in ErrorIgnoreEnoent. However, without resetting errno,
ErrorIgnoreEnoent will ignore unrelated errors from Service::Start() due
to the sticking errono set from other commands.

Bug: 296821716
Test: launch_cvd
Change-Id: I71d3113bdb69bdca82e2ff4f3a793301749f6c08
parent fdbf5a5e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -746,6 +746,7 @@ static Result<void> do_setrlimit(const BuiltinArguments& args) {
static Result<void> do_start(const BuiltinArguments& args) {
    Service* svc = ServiceList::GetInstance().FindService(args[1]);
    if (!svc) return Error() << "service " << args[1] << " not found";
    errno = 0;
    if (auto result = svc->Start(); !result.ok()) {
        return ErrorIgnoreEnoent() << "Could not start service: " << result.error();
    }