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 --- init/init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index 64e5c3e0b..5304e5c2c 100644 --- a/init/init.c +++ b/init/init.c @@ -391,8 +391,10 @@ static int open_stdio_to_tty(const char* tty_name) /* fd can be only < 0 or 0: */ fd = device_open(tty_name, O_RDWR); if (fd) { - message(L_LOG | L_CONSOLE, "can't open %s: %s", - tty_name, strerror(errno)); + message(L_LOG | L_CONSOLE, "can't open %s: "STRERROR_FMT, + tty_name + STRERROR_ERRNO + ); return 0; /* failure */ } dup2(STDIN_FILENO, STDOUT_FILENO); @@ -469,7 +471,7 @@ static void init_exec(const char *command) } /* Here command never contains the dash, cmd[0] might */ BB_EXECVP(command, cmd); - message(L_LOG | L_CONSOLE, "can't run '%s': %s", command, strerror(errno)); + message(L_LOG | L_CONSOLE, "can't run '%s': "STRERROR_FMT, command STRERROR_ERRNO); /* returns if execvp fails */ } -- cgit v1.2.3