summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-10-10 08:11:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-11 16:46:25 +0200
commitb6c514bd1c2e13955ddd6a26df2c33ae74f17d0b (patch)
treec15bcedb9f2f15e41abc69f4bad3a06a92ae7add /lib
parent15111afb387482035fc64ca5b621ec6c933ac7f8 (diff)
downloadbarebox-b6c514bd1c2e13955ddd6a26df2c33ae74f17d0b.tar.gz
barebox-b6c514bd1c2e13955ddd6a26df2c33ae74f17d0b.tar.xz
treewide: replace errno_str() with %m printf format specifier
Both errno_str() and printf("%m" end up calling strerror(). %m is more convenient to use, so switch over all instances to it. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/libfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libfile.c b/lib/libfile.c
index 3b7985fbca..b967232d19 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -387,7 +387,7 @@ int copy_file(const char *src, const char *dst, int verbose)
srcfd = open(src, O_RDONLY);
if (srcfd < 0) {
- printf("could not open %s: %s\n", src, errno_str());
+ printf("could not open %s: %m\n", src);
ret = srcfd;
goto out;
}
@@ -396,7 +396,7 @@ int copy_file(const char *src, const char *dst, int verbose)
s = stat(dst, &dststat);
if (s && s != -ENOENT) {
- printf("could not stat %s: %s\n", dst, errno_str());
+ printf("could not stat %s: %m\n", dst);
ret = s;
goto out;
}
@@ -407,7 +407,7 @@ int copy_file(const char *src, const char *dst, int verbose)
dstfd = open(dst, mode);
if (dstfd < 0) {
- printf("could not open %s: %s\n", dst, errno_str());
+ printf("could not open %s: %m\n", dst);
ret = dstfd;
goto out;
}