From 223d2ac3a671ef607db7621985a8b539c4d28868 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 31473283..fd053072 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 14aa424d..708a308b 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; }