diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-11 20:50:22 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-11 21:33:12 +0100 |
commit | e131a401e894bd484193323d6991a7631b4f53b8 (patch) | |
tree | ee986ad98485e59fe01d2e8930ff9c645477b6ac /Userland | |
parent | 1934a1ec0beee6e9472cb336ebc2566de66cd674 (diff) | |
download | serenity-e131a401e894bd484193323d6991a7631b4f53b8.zip |
cat: Use pledge()
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/cat.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/cat.cpp b/Userland/cat.cpp index 0e8110fdab..5fcd739ec0 100644 --- a/Userland/cat.cpp +++ b/Userland/cat.cpp @@ -9,6 +9,11 @@ int main(int argc, char** argv) { + if (pledge("stdio rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + Vector<int> fds; if (argc > 1) { for (int i = 1; i < argc; i++) { @@ -22,6 +27,12 @@ int main(int argc, char** argv) } else { fds.append(0); } + + if (pledge("stdio", nullptr) < 0) { + perror("pledge"); + return 1; + } + for (auto& fd : fds) { for (;;) { char buf[32768]; |