summaryrefslogtreecommitdiff
path: root/src/user/app/shell/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/app/shell/builtins.c')
-rw-r--r--src/user/app/shell/builtins.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/user/app/shell/builtins.c b/src/user/app/shell/builtins.c
index 734370b..9c294b2 100644
--- a/src/user/app/shell/builtins.c
+++ b/src/user/app/shell/builtins.c
@@ -35,6 +35,10 @@ static void cmd_cat(int argc, char **argv) {
if (len <= 0) break;
fwrite(buf, 1, len, stdout);
}
+ if (ferror(file)) {
+ perror(argv[i]);
+ return;
+ }
fclose(file);
}
}