summaryrefslogtreecommitdiff
path: root/src/user/app/shell/builtins.c
diff options
context:
space:
mode:
authordzwdz2022-09-04 11:37:31 +0200
committerdzwdz2022-09-04 11:37:31 +0200
commita96c69e45428a13b0e16a4fc332694e9f791b24d (patch)
tree025cf8ebeba24c22ee166775724bd8f16861ce29 /src/user/app/shell/builtins.c
parent014edc8e1df0e5070f974367a1b3b4462354410e (diff)
user/shell: use perror
Diffstat (limited to 'src/user/app/shell/builtins.c')
-rw-r--r--src/user/app/shell/builtins.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/user/app/shell/builtins.c b/src/user/app/shell/builtins.c
index 0098773..bc7731c 100644
--- a/src/user/app/shell/builtins.c
+++ b/src/user/app/shell/builtins.c
@@ -24,7 +24,7 @@ static void cmd_cat(int argc, char **argv) {
for (int i = 1; i < argc; i++) {
FILE *file = fopen(argv[i], "r");
if (!file) {
- eprintf("couldn't open %s", argv[i]);
+ perror(argv[i]);
return;
}
if (!strcmp(argv[i], "!stdin")) fextflags(file, FEXT_NOFILL);
@@ -227,7 +227,7 @@ static void cmd_touch(int argc, char **argv) {
for (int i = 1; i < argc; i++) {
FILE *f = fopen(argv[i], "a");
- if (!f) eprintf("couldn't touch %s\n", argv[i]);
+ if (!f) perror(argv[i]);
fclose(f);
}
}