dns: cleanup pid file when dnsmasq process terminated
authorMathieu Trudel-Lapierre <mathieu.tl@gmail.com>
Tue, 22 Mar 2016 14:03:44 +0000 (10:03 -0400)
committerThomas Haller <thaller@redhat.com>
Tue, 22 Mar 2016 15:44:33 +0000 (16:44 +0100)
[thaller@redhat.com: extracted the patch from a larger one]

https://mail.gnome.org/archives/networkmanager-list/2016-March/msg00144.html

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
src/dns-manager/nm-dns-plugin.c

index 0290722..be9673e 100644 (file)
@@ -133,6 +133,12 @@ watch_cb (GPid pid, gint status, gpointer user_data)
        g_free (priv->progname);
        priv->progname = NULL;
 
+       if (priv->pidfile) {
+               unlink (priv->pidfile);
+               g_free (priv->pidfile);
+               priv->pidfile = NULL;
+       }
+
        g_signal_emit (self, signals[CHILD_QUIT], 0, status);
 }