1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:28:13 +00:00

SystemServer: Propagate errors

This patch also includes some changes in the way that the environment
and arguments are passed to `exec`. It was needed to fit the signature
of `Core::System::exec`. That's beneficial though, as we are now doing
`String` manipulation in a fallible environment, so we can propagate
more errors.
This commit is contained in:
Lucas CHOLLET 2023-01-07 18:19:16 -05:00 committed by Andreas Kling
parent cd0b7656fa
commit 81bd91c1c3
3 changed files with 57 additions and 71 deletions

View file

@ -58,7 +58,8 @@ static void sigchld_handler(int)
continue;
}
service->did_exit(status);
if (auto result = service->did_exit(status); result.is_error())
dbgln("{}: {}", service->name(), result.release_error());
}
}
@ -530,8 +531,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
// After we've set them all up, activate them!
dbgln("Activating {} services...", g_services.size());
for (auto& service : g_services)
service.activate();
for (auto& service : g_services) {
if (auto result = service.activate(); result.is_error())
dbgln("{}: {}", service.name(), result.release_error());
}
return event_loop.exec();
}