diff options
author | nandfan <fanyufei521@outlook.com> | 2021-02-22 17:17:17 +0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-02-22 23:14:15 +0000 |
commit | 5fdc47c237b3e370dc18d3ed593ce3bd7c346110 (patch) | |
tree | 49e0592e3de60f50482fe9aadf7dd49eafea210d | |
parent | 6baa45cbf40f800fa1982ba8363a2ebf55b69328 (diff) |
vcl: fix vls_intercept_sigchld_handler be called recursively
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
-rw-r--r-- | src/vcl/vcl_locked.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vcl/vcl_locked.c b/src/vcl/vcl_locked.c index 90ee73546b1..95da1aab54b 100644 --- a/src/vcl/vcl_locked.c +++ b/src/vcl/vcl_locked.c @@ -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; |