summaryrefslogtreecommitdiffstats
path: root/avahi-client
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2005-09-19 04:01:15 +0000
committerTrent Lloyd <lathiat@bur.st>2005-09-19 04:01:15 +0000
commit35368fcb20a354bc30826a38069b7efcc837b618 (patch)
tree90b864b373d1ff2f4a40a7ada100314d7853ed89 /avahi-client
parent6f1ed6cef659805aeaa5b3f7cf80f2fc40e8ffdb (diff)
* Fix error handling in avahi-client so that it actually reports the
error from avahi_client_new, before the ret_error was left untouched. * In the case of a NO_DAEMON error, free the dbus error so that the NO_DAEMON error takes precidence. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@601 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-client')
-rw-r--r--avahi-client/client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/avahi-client/client.c b/avahi-client/client.c
index 93d768a..cbc3004 100644
--- a/avahi-client/client.c
+++ b/avahi-client/client.c
@@ -233,6 +233,7 @@ static int get_server_state(AvahiClient *client, int *ret_error) {
client_set_state(client, (AvahiServerState) state);
+ *ret_error = AVAHI_OK;
return AVAHI_OK;
fail:
@@ -363,6 +364,10 @@ AvahiClient *avahi_client_new(const AvahiPoll *poll_api, AvahiClientCallback cal
if (!(dbus_bus_name_has_owner(client->bus, AVAHI_DBUS_NAME, &error)) ||
dbus_error_is_set(&error)) {
+ /* We free the error so its not set, that way the fail target
+ * will return the NO_DAEMON error rather than a DBUS error */
+ dbus_error_free (&error);
+
if (ret_error)
*ret_error = AVAHI_ERR_NO_DAEMON;