From be73c096d00d99fa2711697ac2a91982babec60c Mon Sep 17 00:00:00 2001 From: Alexis Lina Date: Wed, 1 Jun 2022 13:42:24 +0200 Subject: [PATCH] [core] Add loop with waitpid to avoid zombies process --- libs/esl/ivrd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/esl/ivrd.c b/libs/esl/ivrd.c index 349900bfd2..be4cdc8e19 100644 --- a/libs/esl/ivrd.c +++ b/libs/esl/ivrd.c @@ -41,8 +41,12 @@ static void handle_SIGCHLD(int sig) { int status = 0; + int pid = 0; + + do { + pid = waitpid(-1, &status, WNOHANG); + } while (pid > 0); - wait(&status); return; }