We use sigprocmask to block SIGTERM and SIGINT in main.c, also we
use g_spawn_async_with_pipes to create new process, the new process
will inherit the signal mask with SIGTERM blocked, this will lead
to we can't use connman_task_stop to kill the process
---
src/task.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/task.c b/src/task.c
index b5b9ef7..2fd2567 100644
--- a/src/task.c
+++ b/src/task.c
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <stdarg.h>
#include <sys/wait.h>
+#include <signal.h>
#include <glib.h>
@@ -268,9 +269,14 @@ static void task_died(GPid pid, gint status, gpointer
user_data)
static void task_setup(gpointer user_data)
{
+ sigset_t mask;
struct connman_task *task = user_data;
DBG("task %p", task);
+
+ sigemptyset(&mask);
+ if (sigprocmask(SIG_SETMASK, &mask, NULL) < 0)
+ connman_error("Failed to clean signal mask");
}
/**
--
1.7.2.2
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman