mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Applications+DevTools+MenuApplets: Drop "unix" pledge when possible
Now that the "unix" pledge is no longer required for socket I/O, we can drop it after making the connections we need in a program. In most GUI program cases, once we've connected to the WindowServer by instantiating a GApplication, we no longer need "unix" :^)
This commit is contained in:
parent
114a770c6f
commit
f813bb52a2
Notes:
sideshowbarker
2024-07-19 10:08:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f813bb52a28
12 changed files with 29 additions and 8 deletions
|
@ -50,6 +50,11 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio thread shared_buffer cpath rpath wpath fattr proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GWindow::construct();
|
||||
window->set_title("File Manager");
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio unix shared_buffer rpath", nullptr) < 0) {
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio unix shared_buffer rpath", nullptr) < 0) {
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,11 @@ int main(int argc, char** argv)
|
|||
auto audio_client = AClientConnection::construct();
|
||||
audio_client->handshake();
|
||||
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GWindow::construct();
|
||||
window->set_title("SoundPlayer");
|
||||
window->set_resizable(false);
|
||||
|
|
|
@ -56,7 +56,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio proc shared_buffer rpath unix", nullptr) < 0) {
|
||||
if (pledge("stdio proc shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer proc exec rpath unix", nullptr) < 0) {
|
||||
if (pledge("stdio shared_buffer proc exec rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio tty rpath cpath wpath shared_buffer proc exec unix", nullptr) < 0) {
|
||||
if (pledge("stdio tty rpath cpath wpath shared_buffer proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio rpath cpath wpath shared_buffer unix", nullptr) < 0) {
|
||||
if (pledge("stdio rpath cpath wpath shared_buffer", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -103,6 +103,11 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio tty rpath cpath wpath shared_buffer proc fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function<void()> update_actions;
|
||||
|
||||
g_window = GWindow::construct();
|
||||
|
|
|
@ -69,5 +69,11 @@ int main(int argc, char** argv)
|
|||
auto widget = AudioWidget::construct();
|
||||
window->set_main_widget(widget);
|
||||
window->show();
|
||||
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ int main(int argc, char** argv)
|
|||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue