diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-18 11:35:36 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-18 11:35:47 +0100 |
commit | 7ce3f218af9a56ae3997e93143c23357f208d574 (patch) | |
tree | bac0253162ebffdac678433e0d958062f37657dd | |
parent | 257e7f022a1458bbe34e6556f9df466e9b88cdd6 (diff) | |
download | serenity-7ce3f218af9a56ae3997e93143c23357f208d574.zip |
wc: Use pledge()
-rw-r--r-- | Userland/wc.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/wc.cpp b/Userland/wc.cpp index 60a4c66e13..e2d56d802d 100644 --- a/Userland/wc.cpp +++ b/Userland/wc.cpp @@ -122,6 +122,11 @@ Count get_total_count(Vector<Count>& counts) int main(int argc, char** argv) { + if (pledge("stdio rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + Vector<const char*> files; Core::ArgsParser args_parser; @@ -140,6 +145,11 @@ int main(int argc, char** argv) counts.append(count); } + if (pledge("stdio", nullptr) < 0) { + perror("pledge"); + return 1; + } + if (files.size() > 1) { Count total_count = get_total_count(counts); counts.append(total_count); |