mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
3DFileViewer: Remove unveil() calls and add "thread" pledge
An application that allows opening arbitrary files from the filesystem needs to allow itself to access the filesystem, otherwise there's no point in supporting the feature. :^) And the "thread" pledge is needed for background thumbnail generation.
This commit is contained in:
parent
5419e2b510
commit
df5f382b50
1 changed files with 1 additions and 16 deletions
|
@ -124,26 +124,11 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
|
||||
if (pledge("stdio thread recvfd sendfd rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/home", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil(nullptr, nullptr) < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Construct the main window
|
||||
auto window = GUI::Window::construct();
|
||||
auto app_icon = GUI::Icon::default_icon("app-3d-file-viewer");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue