summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-10-13 13:57:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-13 13:57:07 +0200
commit3d46afb56fa3c5e3c41a382dc454b5bcda04d5ac (patch)
tree957de9cbc6a68e82c84ae26cc4712c3e86dfc964 /commands
parent965a946c49e016bcff5bbfffaa1a468cd74af0db (diff)
parent8513703c6c46428908264923260504ce81e3e3a7 (diff)
downloadbarebox-3d46afb56fa3c5e3c41a382dc454b5bcda04d5ac.tar.gz
Merge branch 'for-next/misc'
Diffstat (limited to 'commands')
-rw-r--r--commands/cat.c2
-rw-r--r--commands/edit.c4
-rw-r--r--commands/flash.c8
-rw-r--r--commands/ls.c3
-rw-r--r--commands/mkdir.c2
-rw-r--r--commands/rm.c2
-rw-r--r--commands/rmdir.c2
7 files changed, 11 insertions, 12 deletions
diff --git a/commands/cat.c b/commands/cat.c
index 17c31ed083..503520dc64 100644
--- a/commands/cat.c
+++ b/commands/cat.c
@@ -40,7 +40,7 @@ static int do_cat(int argc, char *argv[])
fd = open(argv[args], O_RDONLY);
if (fd < 0) {
err = 1;
- printf("could not open %s: %s\n", argv[args], errno_str());
+ printf("could not open %s: %m\n", argv[args]);
goto out;
}
diff --git a/commands/edit.c b/commands/edit.c
index 12695d39e4..dea383aae7 100644
--- a/commands/edit.c
+++ b/commands/edit.c
@@ -185,7 +185,7 @@ static int edit_read_file(const char *path)
if (!stat(path, &s)) {
filebuffer = read_file(path, NULL);
if (!filebuffer) {
- printf("could not read %s: %s\n", path, errno_str());
+ printf("could not read %s: %m\n", path);
return -1;
}
@@ -249,7 +249,7 @@ static int save_file(const char *path)
fd = open(path, O_WRONLY | O_TRUNC | O_CREAT);
if (fd < 0) {
- printf("could not open file for writing: %s\n", errno_str());
+ printf("could not open file for writing: %m\n");
return fd;
}
diff --git a/commands/flash.c b/commands/flash.c
index 3d7c8fd577..5b7060aead 100644
--- a/commands/flash.c
+++ b/commands/flash.c
@@ -25,7 +25,7 @@ static int do_flerase(int argc, char *argv[])
filename = argv[1];
if (stat(filename, &s)) {
- printf("stat %s: %s\n", filename, errno_str());
+ printf("stat %s: %m\n", filename);
return 1;
}
@@ -33,7 +33,7 @@ static int do_flerase(int argc, char *argv[])
fd = open(filename, O_WRONLY);
if (fd < 0) {
- printf("open %s: %s\n", filename, errno_str());
+ printf("open %s: %m\n", filename);
return 1;
}
@@ -89,7 +89,7 @@ static int do_protect(int argc, char *argv[])
prot = 0;
if (stat(filename, &s)) {
- printf("stat %s: %s\n", filename, errno_str());
+ printf("stat %s: %m\n", filename);
return 1;
}
@@ -97,7 +97,7 @@ static int do_protect(int argc, char *argv[])
fd = open(filename, O_WRONLY);
if (fd < 0) {
- printf("open %s: %s\n", filename, errno_str());
+ printf("open %s: %m\n", filename);
return 1;
}
diff --git a/commands/ls.c b/commands/ls.c
index 1192aed971..09a20e0a23 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -164,8 +164,7 @@ static int do_ls(int argc, char *argv[])
while (o < argc) {
ret = stat(argv[o], &s);
if (ret) {
- printf("%s: %s: %s\n", argv[0],
- argv[o], errno_str());
+ printf("%s: %s: %m\n", argv[0], argv[o]);
o++;
exitcode = COMMAND_ERROR;
continue;
diff --git a/commands/mkdir.c b/commands/mkdir.c
index e7153b8732..01fc0b083b 100644
--- a/commands/mkdir.c
+++ b/commands/mkdir.c
@@ -37,7 +37,7 @@ static int do_mkdir(int argc, char *argv[])
ret = mkdir(argv[optind], 0);
}
if (ret) {
- printf("could not create %s: %s\n", argv[optind], errno_str());
+ printf("could not create %s: %m\n", argv[optind]);
return 1;
}
optind++;
diff --git a/commands/rm.c b/commands/rm.c
index ba52b185cb..be5c192221 100644
--- a/commands/rm.c
+++ b/commands/rm.c
@@ -37,7 +37,7 @@ static int do_rm(int argc, char *argv[])
else
ret = unlink(argv[i]);
if (ret) {
- printf("could not remove %s: %s\n", argv[i], errno_str());
+ printf("could not remove %s: %m\n", argv[i]);
return 1;
}
i++;
diff --git a/commands/rmdir.c b/commands/rmdir.c
index 9b2938a556..44793ca56e 100644
--- a/commands/rmdir.c
+++ b/commands/rmdir.c
@@ -14,7 +14,7 @@ static int do_rmdir(int argc, char *argv[])
while (i < argc) {
if (rmdir(argv[i])) {
- printf("could not remove %s: %s\n", argv[i], errno_str());
+ printf("could not remove %s: %m\n", argv[i]);
return 1;
}
i++;