From 6f97b30a904407c1f1701d937d9258ca9175c6ab Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 29 Sep 2017 18:17:25 +0200 Subject: use %m printf specifier where appropriate function old new delta out 85 75 -10 udhcpd_main 1472 1461 -11 open_stdio_to_tty 98 85 -13 init_exec 245 232 -13 udhcpc_main 2763 2749 -14 do_cmd 4771 4755 -16 status_line_bold_errno 32 14 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-95) Total: -95 bytes Signed-off-by: Denys Vlasenko --- shell/ash.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'shell/ash.c') diff --git a/shell/ash.c b/shell/ash.c index 3fa7f4d9f..39705a350 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -1312,16 +1312,9 @@ ash_msg_and_raise_error(const char *msg, ...) } /* - * Use '%m' to append error string on platforms that support it, '%s' and - * strerror() on those that don't. - * * 'fmt' must be a string literal. */ -#ifdef HAVE_PRINTF_PERCENTM -#define ash_msg_and_raise_perror(fmt, ...) ash_msg_and_raise_error(fmt ": %m", ##__VA_ARGS__) -#else -#define ash_msg_and_raise_perror(fmt, ...) ash_msg_and_raise_error(fmt ": %s", ##__VA_ARGS__, strerror(errno)) -#endif +#define ash_msg_and_raise_perror(fmt, ...) ash_msg_and_raise_error(fmt ": "STRERROR_FMT, ##__VA_ARGS__ STRERROR_ERRNO) static void raise_error_syntax(const char *) NORETURN; static void -- cgit v1.2.3