[LEDE-DEV] [PATCH] libopkg: Replace strerror(errno) with %m
Rosen Penev
rosenp at gmail.com
Mon Dec 25 15:00:51 PST 2017
Saves a few bytes. No functional difference.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
libopkg/opkg_conf.c | 2 +-
libopkg/opkg_message.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
index 08855eb..e4de374 100644
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
@@ -450,7 +450,7 @@ static int glob_errfunc(const char *epath, int eerrno)
/* If leading dir does not exist, we get GLOB_NOMATCH. */
return 0;
- opkg_msg(ERROR, "glob failed for %s: %s\n", epath, strerror(eerrno));
+ opkg_msg(ERROR, "glob failed for %s: %m\n", epath);
return 0;
}
diff --git a/libopkg/opkg_message.h b/libopkg/opkg_message.h
index 4110ab9..441fd2d 100644
--- a/libopkg/opkg_message.h
+++ b/libopkg/opkg_message.h
@@ -42,6 +42,6 @@ void opkg_message(message_level_t level, const char *fmt, ...)
} while (0)
#define opkg_perror(l, fmt, args...) \
- opkg_msg(l, fmt": %s.\n", ##args, strerror(errno))
+ opkg_msg(l, fmt": %m.\n", ##args)
#endif /* _OPKG_MESSAGE_H_ */
--
2.7.4
More information about the Lede-dev
mailing list