summaryrefslogtreecommitdiff
path: root/src/dnsmasq-manager
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2012-05-21 14:10:05 +0200
committerJiří Klimeš <jklimes@redhat.com>2012-05-21 15:00:51 +0200
commit78dda3b093b69f0c13773449dc732be5de40f620 (patch)
tree07bc8baf01a130b0fa3d497b5c9b39a674de3361 /src/dnsmasq-manager
parent7054f7ad884379b4f7f8090d626134a9c5b59301 (diff)
downloadNetworkManager-78dda3b093b69f0c13773449dc732be5de40f620.tar.gz
core: unblock signals for child processes we spawn out of NM (rh #739836)
Commit 217c5bf6ac2284261e5c868d393d4b7d02ca5569 fixed processing of unix signals: signals are blocked in all threads and a dedicated thread handles the signals using sigwait(). However, the commit forgot that child processes inherit signal mask as well. That is why we have to unblock signals for child processes we spawn from NM, so that they can receive signals.
Diffstat (limited to 'src/dnsmasq-manager')
-rw-r--r--src/dnsmasq-manager/Makefile.am2
-rw-r--r--src/dnsmasq-manager/nm-dnsmasq-manager.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/dnsmasq-manager/Makefile.am b/src/dnsmasq-manager/Makefile.am
index 66bbdd83f8..8b7dd683cb 100644
--- a/src/dnsmasq-manager/Makefile.am
+++ b/src/dnsmasq-manager/Makefile.am
@@ -1,6 +1,7 @@
INCLUDES = \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src/logging \
+ -I${top_srcdir}/src/posix-signals \
-I${top_srcdir}/src \
-I${top_srcdir}/include
@@ -16,4 +17,5 @@ libdnsmasq_manager_la_CPPFLAGS = \
libdnsmasq_manager_la_LIBADD = \
$(top_builddir)/src/logging/libnm-logging.la \
+ $(top_builddir)/src/posix-signals/libnm-posix-signals.la \
$(GLIB_LIBS)
diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c
index ca2f9dc433..0b3b629f35 100644
--- a/src/dnsmasq-manager/nm-dnsmasq-manager.c
+++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2008 - 2010 Red Hat, Inc.
+ * Copyright (C) 2008 - 2012 Red Hat, Inc.
*/
#include <config.h>
@@ -30,6 +30,7 @@
#include "nm-dnsmasq-manager.h"
#include "nm-logging.h"
#include "nm-glib-compat.h"
+#include "nm-posix-signals.h"
typedef struct {
char *iface;
@@ -356,6 +357,12 @@ dm_child_setup (gpointer user_data G_GNUC_UNUSED)
/* We are in the child process at this point */
pid_t pid = getpid ();
setpgid (pid, pid);
+
+ /*
+ * We blocked signals in main(). We need to restore original signal
+ * mask for dnsmasq here so that it can receive signals.
+ */
+ nm_unblock_posix_signals (NULL);
}
static void