mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 03:48:13 +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
12 changed files with 29 additions and 8 deletions
|
@ -50,6 +50,11 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, 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();
|
auto window = GWindow::construct();
|
||||||
window->set_title("File Manager");
|
window->set_title("File Manager");
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
GApplication app(argc, argv);
|
GApplication app(argc, argv);
|
||||||
|
|
||||||
if (pledge("stdio unix shared_buffer rpath", nullptr) < 0) {
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
perror("pledge");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, argv);
|
GApplication app(argc, argv);
|
||||||
|
|
||||||
if (pledge("stdio unix shared_buffer rpath", nullptr) < 0) {
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
perror("pledge");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,11 @@ int main(int argc, char** argv)
|
||||||
auto audio_client = AClientConnection::construct();
|
auto audio_client = AClientConnection::construct();
|
||||||
audio_client->handshake();
|
audio_client->handshake();
|
||||||
|
|
||||||
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
auto window = GWindow::construct();
|
auto window = GWindow::construct();
|
||||||
window->set_title("SoundPlayer");
|
window->set_title("SoundPlayer");
|
||||||
window->set_resizable(false);
|
window->set_resizable(false);
|
||||||
|
|
|
@ -56,7 +56,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, 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");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, 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");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, 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");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, 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");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,11 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, 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;
|
Function<void()> update_actions;
|
||||||
|
|
||||||
g_window = GWindow::construct();
|
g_window = GWindow::construct();
|
||||||
|
|
|
@ -69,5 +69,11 @@ int main(int argc, char** argv)
|
||||||
auto widget = AudioWidget::construct();
|
auto widget = AudioWidget::construct();
|
||||||
window->set_main_widget(widget);
|
window->set_main_widget(widget);
|
||||||
window->show();
|
window->show();
|
||||||
|
|
||||||
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, argv);
|
GApplication app(argc, argv);
|
||||||
|
|
||||||
if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
perror("pledge");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
GApplication app(argc, argv);
|
GApplication app(argc, argv);
|
||||||
|
|
||||||
if (pledge("stdio shared_buffer rpath unix", nullptr) < 0) {
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
perror("pledge");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue