summaryrefslogtreecommitdiff
path: root/src/task.c
diff options
context:
space:
mode:
authorYu A Wang <yu.a.wang@intel.com>2011-08-17 04:04:32 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-08-17 10:51:28 +0200
commit064b6a4f86c465bcfdb88b7a9446355462d78cfd (patch)
tree859be326c700619f2a2ebb0902581715cf38746d /src/task.c
parentd48d264504adee79da711698cd6eb81096b5c8d7 (diff)
downloadconnman-064b6a4f86c465bcfdb88b7a9446355462d78cfd.tar.gz
connman-064b6a4f86c465bcfdb88b7a9446355462d78cfd.tar.bz2
connman-064b6a4f86c465bcfdb88b7a9446355462d78cfd.zip
task: Reset forked process signal mask
The forked process inherits connmand's signal mask and thus has TERM and INT blocked. As a consequence it can not be killed properly if the signal mask is not reset.
Diffstat (limited to 'src/task.c')
-rw-r--r--src/task.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/task.c b/src/task.c
index b5b9ef74..2fd2567a 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");
}
/**