summaryrefslogtreecommitdiff
path: root/Userland/yes.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-18 10:46:06 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-18 11:35:47 +0100
commitd6a1237cfe7585e2722f4861ef08fb72a3252cca (patch)
tree27e826d3e0df03fc0426c2338223874bc1f12bf3 /Userland/yes.cpp
parent00fa2aa0ec268ab8052db7cbd8a1dfa34c388b0e (diff)
downloadserenity-d6a1237cfe7585e2722f4861ef08fb72a3252cca.zip
yes: Use pledge()
Diffstat (limited to 'Userland/yes.cpp')
-rw-r--r--Userland/yes.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/yes.cpp b/Userland/yes.cpp
index a029b9dd46..58ac1f2c27 100644
--- a/Userland/yes.cpp
+++ b/Userland/yes.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;
+ }
+
if (argc > 1) {
for (;;) {
puts(argv[1]);