summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-worker-job.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-06-15 12:00:25 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2010-06-15 12:17:16 -0400
commit712cd8d8faa05151f979ac3baf53868bae78c7f8 (patch)
tree66c0efab8b8e43679e2d5b6be22346ad2edb0a01 /daemon/gdm-session-worker-job.c
parent85ac2e9047e7518153241ac71c50ba9e2fd0a4c2 (diff)
downloadgdm-712cd8d8faa05151f979ac3baf53868bae78c7f8.tar.gz
Terminate subprocesses after the slave dies
This will help prevent leaving the system in an inconsistent state. https://bugzilla.gnome.org/show_bug.cgi?id=621661
Diffstat (limited to 'daemon/gdm-session-worker-job.c')
-rw-r--r--daemon/gdm-session-worker-job.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c
index 633d6e29..149d83a6 100644
--- a/daemon/gdm-session-worker-job.c
+++ b/daemon/gdm-session-worker-job.c
@@ -32,6 +32,9 @@
#include <pwd.h>
#include <grp.h>
#include <signal.h>
+#if defined (__linux__)
+#include <sys/prctl.h>
+#endif
#include <glib.h>
#include <glib/gi18n.h>
@@ -84,6 +87,10 @@ G_DEFINE_TYPE (GdmSessionWorkerJob, gdm_session_worker_job, G_TYPE_OBJECT)
static void
session_worker_job_child_setup (GdmSessionWorkerJob *session_worker_job)
{
+ /* Terminate the process when the parent dies */
+#if defined (__linux__)
+ prctl (PR_SET_PDEATHSIG, SIGTERM);
+#endif
}
static void