about summary refs log tree commit diff
path: root/src/dns-manager/nm-dns-plugin.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2015-07-14 19:39:12 +0200
committerMichael Biebl <biebl@debian.org>2015-07-14 19:39:12 +0200
commit34b1c46437df982495d08a8bbb8bd0b262d8af48 (patch)
tree1db29ec39d9f733922b3a33cabcc8e6486fa06aa /src/dns-manager/nm-dns-plugin.c
parent50fc50153b0036516b853aa576dc435bd53ce736 (diff)
parent50a58f0fabd8a34c1b6108a107e08abe3c1ccd24 (diff)
Merge tag 'upstream/1.0.4'
Upstream version 1.0.4
Diffstat (limited to 'src/dns-manager/nm-dns-plugin.c')
-rw-r--r--src/dns-manager/nm-dns-plugin.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c
index c684464e..5b95d1c5 100644
--- a/src/dns-manager/nm-dns-plugin.c
+++ b/src/dns-manager/nm-dns-plugin.c
@@ -28,7 +28,6 @@
 
 #include "nm-dns-plugin.h"
 #include "nm-logging.h"
-#include "nm-posix-signals.h"
 #include "NetworkManagerUtils.h"
 
 typedef struct {
@@ -136,20 +135,6 @@ watch_cb (GPid pid, gint status, gpointer user_data)
 	g_signal_emit (self, signals[CHILD_QUIT], 0, status);
 }
 
-static void
-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 DNS plugin here so that it can receive signals.
-	 */
-	nm_unblock_posix_signals (NULL);
-}
-
 GPid
 nm_dns_plugin_child_spawn (NMDnsPlugin *self,
                            const char **argv,
@@ -183,8 +168,8 @@ nm_dns_plugin_child_spawn (NMDnsPlugin *self,
 	priv->pid = 0;
 	if (g_spawn_async (NULL, (char **) argv, NULL,
 	                   G_SPAWN_DO_NOT_REAP_CHILD,
-	                   child_setup,
-	                   NULL, &priv->pid,
+	                   nm_utils_setpgid, NULL,
+	                   &priv->pid,
 	                   &error)) {
 		nm_log_dbg (LOGD_DNS, "%s started with pid %d", priv->progname, priv->pid);
 		priv->watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) watch_cb, self);