mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-14 13:21:00 +01:00
MINOR: mworker/cli: only keep positive PIDs in proc_list
Change mworker_env_to_proc_list() to if (child->pid > 0) before LIST_APPEND, avoiding invalid PIDs (0/-1) in the process list. This has no functional impact beyond stricter validation and it aligns with existing kill safeguards.
This commit is contained in:
parent
6970c8b8b6
commit
c30eeb2967
@ -223,7 +223,7 @@ int mworker_env_to_proc_list()
|
||||
child->version = strdup(subtoken+8);
|
||||
}
|
||||
}
|
||||
if (child->pid) {
|
||||
if (child->pid > 0) {
|
||||
LIST_APPEND(&proc_list, &child->list);
|
||||
} else {
|
||||
mworker_free_child(child);
|
||||
@ -909,6 +909,7 @@ static int cli_io_handler_show_proc(struct appctx *appctx)
|
||||
/* dump complete */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* reload the master process */
|
||||
static int cli_parse_show_proc(char **args, char *payload, struct appctx *appctx, void *private)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user