mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
ldpd: redundant condition (cppcheck)
Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
parent
6389e663e9
commit
0e8d7233e3
30
ldpd/ldpd.c
30
ldpd/ldpd.c
@ -406,16 +406,32 @@ ldpd_shutdown(void)
|
|||||||
free(vty_conf);
|
free(vty_conf);
|
||||||
|
|
||||||
log_debug("waiting for children to terminate");
|
log_debug("waiting for children to terminate");
|
||||||
do {
|
|
||||||
|
while (true) {
|
||||||
|
/* Wait for child process. */
|
||||||
pid = wait(&status);
|
pid = wait(&status);
|
||||||
if (pid == -1) {
|
if (pid == -1) {
|
||||||
if (errno != EINTR && errno != ECHILD)
|
/* We got interrupted, try again. */
|
||||||
fatal("wait");
|
if (errno == EINTR)
|
||||||
} else if (WIFSIGNALED(status))
|
continue;
|
||||||
|
/* No more processes were found. */
|
||||||
|
if (errno != ECHILD)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Unhandled errno condition. */
|
||||||
|
fatal("wait");
|
||||||
|
/* UNREACHABLE */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We found something, lets announce it. */
|
||||||
|
if (WIFSIGNALED(status))
|
||||||
log_warnx("%s terminated; signal %d",
|
log_warnx("%s terminated; signal %d",
|
||||||
(pid == lde_pid) ? "label decision engine" :
|
(pid == lde_pid ? "label decision engine"
|
||||||
"ldp engine", WTERMSIG(status));
|
: "ldp engine"),
|
||||||
} while (pid != -1 || (pid == -1 && errno == EINTR));
|
WTERMSIG(status));
|
||||||
|
|
||||||
|
/* Repeat until there are no more child processes. */
|
||||||
|
}
|
||||||
|
|
||||||
free(iev_ldpe);
|
free(iev_ldpe);
|
||||||
free(iev_lde);
|
free(iev_lde);
|
||||||
|
Loading…
Reference in New Issue
Block a user