Debian #458802
GNOME #517526

Index: gdm-2.20.7/daemon/gdm.c
===================================================================
--- gdm-2.20.7.orig/daemon/gdm.c	2008-06-30 19:53:13.000000000 +0200
+++ gdm-2.20.7/daemon/gdm.c	2008-09-03 13:01:06.066776853 +0200
@@ -293,6 +293,22 @@
 	const char *pidfile;
 	gboolean first;
 	GSList *displays;
+	struct sigaction sig;
+
+	/* Remove all signal handlers, since we are freeing structures used by the handlers */
+	sig.sa_handler = SIG_DFL;
+	sig.sa_flags = SA_RESTART;
+	sigemptyset (&sig.sa_mask);
+	sigaction (SIGTERM, &sig, NULL);
+	sigaction (SIGINT,  &sig, NULL);
+	sigaction (SIGHUP,  &sig, NULL);
+	sigaction (SIGUSR1, &sig, NULL);
+#ifdef SIGXCPU
+	sigaction (SIGXCPU, &sig, NULL);
+#endif
+#ifdef SIGXFSZ
+	sigaction (SIGXFSZ, &sig, NULL);
+#endif
 
 	displays = gdm_daemon_config_get_display_list ();
 
@@ -708,6 +724,7 @@
 		change_to_first_and_clear (FALSE);
 #endif /* __linux */
 
+		_exit (EXIT_SUCCESS);
 	}
 }
 
@@ -728,6 +745,7 @@
 		change_to_first_and_clear (TRUE);
 #endif /* __linux */
 
+	_exit (EXIT_SUCCESS);
 	}
 }
 
