summaryrefslogtreecommitdiff
path: root/src/user/app/shell
diff options
context:
space:
mode:
authordzwdz2023-07-19 21:27:15 +0200
committerdzwdz2023-07-19 21:27:15 +0200
commit2d7da42acbf2782636e481ebd79f30700fb7dc9e (patch)
treece818cbd3e8240b5d9c55147b21f2196f0b4e59b /src/user/app/shell
parent6b085892a0e99c21ccb2d94a2edab91cc4f87ad1 (diff)
user /keyboard: handle open()s instantly even if waiting for kb
fixes e.g. `echo */*` in dash
Diffstat (limited to 'src/user/app/shell')
-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);
}
}