diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-18 10:47:23 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-18 11:35:47 +0100 |
commit | 1612a1d4898eb65a14130265265cabe566b4ecbf (patch) | |
tree | 904bee30fcd8b2bffd80d14a29b5293616995ec5 | |
parent | d6a1237cfe7585e2722f4861ef08fb72a3252cca (diff) | |
download | serenity-1612a1d4898eb65a14130265265cabe566b4ecbf.zip |
echo: Use pledge()
-rw-r--r-- | Userland/echo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/echo.cpp b/Userland/echo.cpp index 8a5c9f01d5..ba35732508 100644 --- a/Userland/echo.cpp +++ b/Userland/echo.cpp @@ -25,9 +25,15 @@ */ #include <stdio.h> +#include <unistd.h> int main(int argc, char** argv) { + if (pledge("stdio", nullptr) < 0) { + perror("pledge"); + return 1; + } + for (int i = 1; i < argc; ++i) { fputs(argv[i], stdout); if (i != argc - 1) |