From ee8de77a90bee1e29206e8dc4aaac1450ad85c0b Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 10 Jun 2023 17:34:10 +0300 Subject: [PATCH] Userspace: fix return values of cat and echo --- userspace/cat/main.cpp | 5 +++-- userspace/echo/main.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/userspace/cat/main.cpp b/userspace/cat/main.cpp index 31473283c9..fd0530729d 100644 --- a/userspace/cat/main.cpp +++ b/userspace/cat/main.cpp @@ -32,14 +32,15 @@ int main(int argc, char** argv) ret = 1; continue; } - if (cat_file(fp)) + if (!cat_file(fp)) ret = 1; fclose(fp); } } else { - ret = cat_file(stdin); + if (!cat_file(stdin)) + ret = 1; } return ret; diff --git a/userspace/echo/main.cpp b/userspace/echo/main.cpp index 14aa424d55..708a308baa 100644 --- a/userspace/echo/main.cpp +++ b/userspace/echo/main.cpp @@ -36,5 +36,5 @@ int main(int argc, char** argv) fputc(' ', stdout); } printf("\n"); - return 1; + return 0; }