1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

HackStudio: Use Core::System APIs where possible

This commit is contained in:
Sam Atkins 2024-01-11 16:55:49 +00:00 committed by Andrew Kaster
parent 16543a1918
commit 336b8ed80b
4 changed files with 23 additions and 15 deletions

View file

@ -29,12 +29,12 @@ void ConnectionFromClient::die()
void ConnectionFromClient::greet(ByteString const& project_root)
{
m_filedb.set_project_root(project_root);
if (unveil(project_root.characters(), "r") < 0) {
perror("unveil");
if (auto result = Core::System::unveil(project_root, "r"sv); result.is_error()) {
warnln("Failed to unveil `{}`: {}", project_root, result.error());
exit(1);
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
if (auto result = Core::System::unveil(nullptr, nullptr); result.is_error()) {
warnln("Failed to lock the veil: {}", result.error());
exit(1);
}
}