[gnome-builder/wip/chergert/multi-process] app: kill worker process with parent



commit d5e260a25c05b31d9da5c1d3cce75fc92b9ed2bc
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 20 00:15:28 2015 -0700

    app: kill worker process with parent

 src/app/gb-application.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 7f5256d..4ac74be 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -22,6 +22,10 @@
 # include "config.h"
 #endif
 
+#ifdef __linux
+# include <sys/prctl.h>
+#endif
+
 #include <glib/gi18n.h>
 #include <gtksourceview/gtksource.h>
 
@@ -63,6 +67,11 @@ gb_application_load_worker (GbApplication *self)
   g_assert (GB_IS_APPLICATION (self));
   g_assert (gb_application_is_worker (self));
 
+#ifdef __linux
+  /* Ensure we are killed with our parent */
+  prctl (PR_SET_PDEATHSIG, 15);
+#endif
+
   connection = g_dbus_connection_new_for_address_sync (self->dbus_address,
                                                        G_DBUS_CONNECTION_FLAGS_NONE,
                                                        NULL, NULL, &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]