summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon/gdm-welcome-session.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/gdm-welcome-session.c b/daemon/gdm-welcome-session.c
index 778d5dce..3431edba 100644
--- a/daemon/gdm-welcome-session.c
+++ b/daemon/gdm-welcome-session.c
@@ -32,6 +32,9 @@
#include <pwd.h>
#include <grp.h>
#include <signal.h>
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
#include <glib.h>
#include <glib/gi18n.h>
@@ -469,6 +472,11 @@ spawn_child_setup (SpawnChildData *data)
_exit (2);
}
+ /* Terminate the process when the parent dies */
+#ifdef HAVE_SYS_PRCTL_H
+ prctl (PR_SET_PDEATHSIG, SIGTERM);
+#endif
+
if (data->log_file != NULL) {
int logfd;