mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
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:
parent
44537379fc
commit
df7f16d960
@ -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)
|
static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *appctx, void *private)
|
||||||
{
|
{
|
||||||
const char **build_opt;
|
const char **build_opt;
|
||||||
|
char *err = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (*args[2])
|
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));
|
post_mortem.process.caps.boot[1].inheritable));
|
||||||
} else
|
} else
|
||||||
chunk_appendf(&trash, " capget() failed at boot with: %s.\n",
|
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 */
|
/* let's print actual capabilities sets, could be useful in order to compare */
|
||||||
if (!post_mortem.process.caps.err_run) {
|
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));
|
post_mortem.process.caps.run[1].inheritable));
|
||||||
} else
|
} else
|
||||||
chunk_appendf(&trash, " capget() failed at runtime with: %s.\n",
|
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
|
#endif
|
||||||
chunk_appendf(&trash, " boot limits:\n");
|
chunk_appendf(&trash, " boot limits:\n");
|
||||||
chunk_appendf(&trash, " \tfd limit (soft): %s\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",
|
chunk_appendf(&trash, " \tram limit (hard): %s\n",
|
||||||
LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_max), "unlimited"));
|
LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_max), "unlimited"));
|
||||||
|
|
||||||
|
ha_free(&err);
|
||||||
|
|
||||||
return cli_msg(appctx, LOG_INFO, trash.area);
|
return cli_msg(appctx, LOG_INFO, trash.area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user