summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-21 12:03:08 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-21 12:03:08 +0100
commit39931733a52ec72ad905a363225efb895775262f (patch)
tree03742443d6979c88abe37b0b7ea2fd7a0c741462 /Applications
parent1b3cac2f42ea8dd9026b541bc705f5909fef71ed (diff)
downloadserenity-39931733a52ec72ad905a363225efb895775262f.zip
Calculator: Use unveil()
A barebones GUI app like this only needs read access to /res (for fonts and themes, in case settings change) once it's up and running.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Calculator/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Applications/Calculator/main.cpp b/Applications/Calculator/main.cpp
index e52dff0254..e43f28a8df 100644
--- a/Applications/Calculator/main.cpp
+++ b/Applications/Calculator/main.cpp
@@ -47,6 +47,13 @@ int main(int argc, char** argv)
return 1;
}
+ if (unveil("/res", "r") < 0) {
+ perror("unveil");
+ return 1;
+ }
+
+ unveil(nullptr, nullptr);
+
auto window = GWindow::construct();
window->set_title("Calculator");
window->set_resizable(false);