1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

ChessEngine: Use pledge and unveil

This commit is contained in:
Brendan Coles 2020-11-01 20:45:14 +00:00 committed by Andreas Kling
parent 9f8a8e07c2
commit 328915a279

View file

@ -30,7 +30,20 @@
int main() int main()
{ {
if (pledge("stdio shared_buffer accept unix rpath cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
Core::EventLoop loop; Core::EventLoop loop;
if (pledge("stdio shared_buffer unix", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto engine = ChessEngine::construct(Core::File::stdin(), Core::File::stdout()); auto engine = ChessEngine::construct(Core::File::stdin(), Core::File::stdout());
return loop.exec(); return loop.exec();
} }