$NetBSD: patch-ac,v 1.9 2006/11/28 22:17:24 drochner Exp $

--- gnome-session/main.c.orig	2006-11-20 00:24:40.000000000 +0100
+++ gnome-session/main.c
@@ -43,6 +43,7 @@
 #include "command.h"
 #include "splash-widget.h"
 #include "util.h"
+#include "gsm-dbus.h"
 #include "gsm-sound.h"
 #include "gsm-gsd.h"
 #include "gsm-proxy.h"
@@ -336,6 +337,7 @@ main (int argc, char *argv[])
   char **versions;
   GConfClient *gconf_client;
   GOptionContext *goption_context;
+  gboolean dbus_daemon_owner;
   
   if (getenv ("GSM_VERBOSE_DEBUG"))
     gsm_set_verbose (TRUE);
@@ -420,6 +422,7 @@ main (int argc, char *argv[])
   fprintf (stderr, "SESSION_MANAGER=%s\n", getenv ("SESSION_MANAGER"));
   gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-session.png");
 
+  dbus_daemon_owner = gsm_dbus_daemon_start ();
 
   /* Make sure children see the right value for DISPLAY.  This is
      useful if --display was specified on the command line.  */
@@ -506,6 +509,9 @@ main (int argc, char *argv[])
 
   gsm_keyring_daemon_stop ();
 
+  if (dbus_daemon_owner)
+	gsm_dbus_daemon_stop ();
+
   g_object_unref (gconf_client);
   gsm_shutdown_gconfd ();
 
