summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-12 13:22:34 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-12 13:22:34 +0100
commit22cf24cba7296fb2d908c0e8d8040a581dcce59b (patch)
tree055fa92ac40e95391d2ab4e34eff6d78ed44397c /Applications
parente588a41ac9ca1c5001e00a0055bdb8651e0ca37e (diff)
downloadserenity-22cf24cba7296fb2d908c0e8d8040a581dcce59b.zip
ChanViewer: Use pledge()
This app should be ported to LibProtocol, which would allow it to drop "inet" and "dns" as well.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/ChanViewer/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Applications/ChanViewer/main.cpp b/Applications/ChanViewer/main.cpp
index 7b977fdddf..de23ba6032 100644
--- a/Applications/ChanViewer/main.cpp
+++ b/Applications/ChanViewer/main.cpp
@@ -10,11 +10,22 @@
#include <LibGUI/GStatusBar.h>
#include <LibGUI/GTableView.h>
#include <LibGUI/GWindow.h>
+#include <stdio.h>
int main(int argc, char** argv)
{
+ if (pledge("stdio dns inet shared_buffer rpath cpath fattr", nullptr) < 0) {
+ perror("pledge");
+ return 1;
+ }
+
GApplication app(argc, argv);
+ if (pledge("stdio dns inet shared_buffer rpath", nullptr) < 0) {
+ perror("pledge");
+ return 1;
+ }
+
auto window = GWindow::construct();
window->set_title("ChanViewer");
window->set_rect(100, 100, 800, 500);