]> git.meshlink.io Git - catta/commitdiff
* drop useless argument
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Aug 2005 23:45:27 +0000 (23:45 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Aug 2005 23:45:27 +0000 (23:45 +0000)
* do NOT call _exit when DBUS connection dies
* don't print directly to STDOUT, that's what DBusError is for
* small optimization

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@434 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-client/client.c

index 27f746206670a13fe28722d94ef91d6aa810e7e1..837d237bcf9a1721bc3947e975815205f7370c0d 100644 (file)
@@ -235,14 +235,14 @@ fail:
 /* This function acts like dbus_bus_get but creates a private
  * connection instead */
 static DBusConnection*
-avahi_dbus_bus_get (DBusBusType type, DBusError *error)
+avahi_dbus_bus_get (DBusError *error)
 {
     DBusConnection *conn;
     char *env_addr;
 
     env_addr = getenv ("DBUS_SYSTEM_BUS_ADDRESS");
 
-    if (env_addr == NULL || (strcmp (env_addr, "") == 0))
+    if (env_addr == NULL || (*env_addr == 0))
     {
         env_addr = DBUS_SYSTEM_BUS_DEFAULT_ADDRESS;
     }
@@ -250,16 +250,12 @@ avahi_dbus_bus_get (DBusBusType type, DBusError *error)
     conn = dbus_connection_open_private (env_addr, error);
 
     if (!conn)
-    {
-        printf ("Failed to open private connection: %s\n", error->message);
         return NULL;
-    }
 
-    dbus_connection_set_exit_on_disconnect (conn, TRUE);
+    dbus_connection_set_exit_on_disconnect (conn, FALSE);
 
     if (!dbus_bus_register (conn, error))
     {
-        printf ("Failed to register connection\n");
         dbus_connection_close (conn);
         dbus_connection_unref (conn);
 
@@ -298,7 +294,7 @@ AvahiClient *avahi_client_new(const AvahiPoll *poll_api, AvahiClientCallback cal
     AVAHI_LLIST_HEAD_INIT(AvahiServiceTypeBrowser, client->service_type_browsers);
     AVAHI_LLIST_HEAD_INIT(AvahiServiceResolver, client->service_resolvers);
 
-    if (!(client->bus = avahi_dbus_bus_get(DBUS_BUS_SYSTEM, &error)) ||
+    if (!(client->bus = avahi_dbus_bus_get(&error)) ||
         dbus_error_is_set (&error))
         goto fail;