vcl: fix vls_intercept_sigchld_handler be called recursively 75/31375/2
authornandfan <fanyufei521@outlook.com>
Mon, 22 Feb 2021 09:17:17 +0000 (17:17 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 22 Feb 2021 23:14:15 +0000 (23:14 +0000)
The old_sa is rewrite with vls_intercept_sigchld_handler when parent
process fork child second time, parent process will call
vls_intercept_sigchld_handler recursively when received child signal.

Type: fix

Signed-off-by: nandfan <fanyufei521@outlook.com>
Change-Id: Ia58a254d58058489aa2d91b76a3b3cab1e38f802

src/vcl/vcl_locked.c

index 90ee735..95da1aa 100644 (file)
@@ -1561,6 +1561,11 @@ static void
 vls_incercept_sigchld ()
 {
   struct sigaction sa;
+  if (old_sa.sa_sigaction)
+    {
+      VDBG (0, "have intercepted sigchld");
+      return;
+    }
   clib_memset (&sa, 0, sizeof (sa));
   sa.sa_sigaction = vls_intercept_sigchld_handler;
   sa.sa_flags = SA_SIGINFO;