diff options
author | Yu A Wang <yu.a.wang@intel.com> | 2011-08-17 04:04:32 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-08-17 10:51:28 +0200 |
commit | 064b6a4f86c465bcfdb88b7a9446355462d78cfd (patch) | |
tree | 859be326c700619f2a2ebb0902581715cf38746d /src/task.c | |
parent | d48d264504adee79da711698cd6eb81096b5c8d7 (diff) | |
download | connman-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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"); } /** |