From 2d7da42acbf2782636e481ebd79f30700fb7dc9e Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 19 Jul 2023 21:27:15 +0200 Subject: user /keyboard: handle open()s instantly even if waiting for kb fixes e.g. `echo */*` in dash --- src/user/app/shell/builtins.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/user/app/shell') 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); } } -- cgit v1.2.3