MINOR: debug: debug_parse_cli_show_dev: use errname

Let's use errname, introduced in the previous commit in the output of
"show dev". This output is destined to engineers. So, no need to provide a
long descriptions of errnos given by strerror.
This commit is contained in:
Valentine Krasnobaeva 2024-09-21 18:20:19 +02:00 committed by Willy Tarreau
parent 44537379fc
commit df7f16d960

View File

@ -542,6 +542,7 @@ static int debug_parse_cli_show_libs(char **args, char *payload, struct appctx *
static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *appctx, void *private)
{
const char **build_opt;
char *err = NULL;
int i;
if (*args[2])
@ -616,7 +617,7 @@ static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *a
post_mortem.process.caps.boot[1].inheritable));
} else
chunk_appendf(&trash, " capget() failed at boot with: %s.\n",
strerror(post_mortem.process.caps.err_boot));
errname(post_mortem.process.caps.err_boot, &err));
/* let's print actual capabilities sets, could be useful in order to compare */
if (!post_mortem.process.caps.err_run) {
@ -632,7 +633,7 @@ static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *a
post_mortem.process.caps.run[1].inheritable));
} else
chunk_appendf(&trash, " capget() failed at runtime with: %s.\n",
strerror(post_mortem.process.caps.err_run));
errname(post_mortem.process.caps.err_run, &err));
#endif
chunk_appendf(&trash, " boot limits:\n");
chunk_appendf(&trash, " \tfd limit (soft): %s\n",
@ -654,6 +655,8 @@ static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *a
chunk_appendf(&trash, " \tram limit (hard): %s\n",
LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_max), "unlimited"));
ha_free(&err);
return cli_msg(appctx, LOG_INFO, trash.area);
}