Patches by Kjartan Maraas <kmaraas at gnome dot org>
[platform/upstream/dbus.git] / dbus / dbus-server-debug-pipe.c
index 9f1d55f..0917c1e 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2003  CodeFactory AB
  * Copyright (C) 2003, 2004  Red Hat, Inc.
  *
- * Licensed under the Academic Free License version 2.0
+ * Licensed under the Academic Free License version 2.1
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -134,6 +134,7 @@ _dbus_server_debug_pipe_new (const char     *server_name,
 {
   DBusServerDebugPipe *debug_server;
   DBusString address;
+  DBusString name_str;
   
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
   
@@ -154,8 +155,9 @@ _dbus_server_debug_pipe_new (const char     *server_name,
   if (!_dbus_string_init (&address))
     goto nomem_1;
 
+  _dbus_string_init_const (&name_str, server_name);
   if (!_dbus_string_append (&address, "debug-pipe:name=") ||
-      !_dbus_string_append (&address, server_name))
+      !_dbus_address_append_escaped (&address, &name_str))
     goto nomem_2;
   
   debug_server->name = _dbus_strdup (server_name);
@@ -255,7 +257,7 @@ _dbus_transport_debug_pipe_new (const char     *server_name,
   _dbus_fd_set_close_on_exec (server_fd);
   
   client_transport = _dbus_transport_new_for_fd (client_fd,
-                                                 FALSE, &address);
+                                                 NULL, &address);
   if (client_transport == NULL)
     {
       _dbus_close (client_fd, NULL);
@@ -268,9 +270,9 @@ _dbus_transport_debug_pipe_new (const char     *server_name,
   _dbus_string_free (&address);
   
   client_fd = -1;
-  
+
   server_transport = _dbus_transport_new_for_fd (server_fd,
-                                                 TRUE, NULL);
+                                                 &server->guid_hex, NULL);
   if (server_transport == NULL)
     {
       _dbus_transport_unref (client_transport);
@@ -287,7 +289,7 @@ _dbus_transport_debug_pipe_new (const char     *server_name,
       dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
       _dbus_transport_unref (server_transport);
       _dbus_transport_unref (client_transport);
-      return FALSE;
+      return NULL;
     }
   
   connection = _dbus_connection_new_for_transport (server_transport);