Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetar Paradzik <petar.paradzik@sartura.hr>2017-07-03 14:37:56 +0300
committerFelix Fietkau <nbd@nbd.name>2017-09-29 14:37:17 +0300
commitf714be125c9b85e184a482bc22e958b5cadfad3a (patch)
treedd038c32300393206acdb9c5944ef03043e68690 /uloop.c
parent7a1057604ed2ad83434ed3be03728065b14a5e9c (diff)
uloop: make SIGCHLD signal handling optional
Some programs want to manage their own child life cycle without using SIGCHLD signal handler. In these cases, uloop is reaping children for them because they don't have SIGCHLD handler set. This patch makes it possible to disable reaping children through 'uloop_handle_sigchld' variable. Signed-off-by: Petar Paradzik <petar.paradzik@sartura.hr>
Diffstat (limited to 'uloop.c')
-rw-r--r--uloop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/uloop.c b/uloop.c
index 3813e18..8517366 100644
--- a/uloop.c
+++ b/uloop.c
@@ -58,6 +58,7 @@ static struct list_head processes = LIST_HEAD_INIT(processes);
static int poll_fd = -1;
bool uloop_cancelled = false;
+bool uloop_handle_sigchld = true;
static int uloop_status = 0;
static bool do_sigchld = false;
@@ -466,7 +467,9 @@ static void uloop_setup_signals(bool add)
uloop_install_handler(SIGINT, uloop_handle_sigint, &old_sigint, add);
uloop_install_handler(SIGTERM, uloop_handle_sigint, &old_sigterm, add);
- uloop_install_handler(SIGCHLD, uloop_sigchld, &old_sigchld, add);
+
+ if (uloop_handle_sigchld)
+ uloop_install_handler(SIGCHLD, uloop_sigchld, &old_sigchld, add);
uloop_ignore_signal(SIGPIPE, add);
}