ChessEngine: Use pledge and unveil
This commit is contained in:
parent
9f8a8e07c2
commit
328915a279
Notes:
sideshowbarker
2024-07-19 01:35:05 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/328915a2798 Pull-request: https://github.com/SerenityOS/serenity/pull/3908 Reviewed-by: https://github.com/petelliott ✅
1 changed files with 13 additions and 0 deletions
|
@ -30,7 +30,20 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
if (pledge("stdio shared_buffer accept unix rpath cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
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());
|
||||
return loop.exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue