X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-client%2Fentrygroup.c;h=e43a44fb8ae42b61db5785ce7f084d0141187d58;hb=6d523588a3b3a4c62bfe6efeee01acf038384ca6;hp=50afb126c41589f873fb1762b26a60ce2ff24049;hpb=21dd860429b6a3065118fdba4b298cdb19c28d15;p=catta diff --git a/avahi-client/entrygroup.c b/avahi-client/entrygroup.c index 50afb12..e43a44f 100644 --- a/avahi-client/entrygroup.c +++ b/avahi-client/entrygroup.c @@ -111,7 +111,7 @@ AvahiEntryGroup* avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCall dbus_error_init (&error); - if (client->state == AVAHI_CLIENT_DISCONNECTED) { + if (!avahi_client_is_connected(client)) { avahi_client_set_errno(client, AVAHI_ERR_BAD_STATE); goto fail; } @@ -237,7 +237,7 @@ int avahi_entry_group_free(AvahiEntryGroup *group) { assert(group); - if (group->path && client->state != AVAHI_CLIENT_DISCONNECTED) + if (group->path && avahi_client_is_connected(client)) r = entry_group_simple_method_call(group, "Free"); AVAHI_LLIST_REMOVE(AvahiEntryGroup, groups, client->groups, group); @@ -251,7 +251,7 @@ int avahi_entry_group_free(AvahiEntryGroup *group) { int avahi_entry_group_commit(AvahiEntryGroup *group) { assert(group); - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); return entry_group_simple_method_call(group, "Commit"); @@ -260,7 +260,7 @@ int avahi_entry_group_commit(AvahiEntryGroup *group) { int avahi_entry_group_reset(AvahiEntryGroup *group) { assert(group); - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); return entry_group_simple_method_call(group, "Reset"); @@ -288,7 +288,7 @@ int avahi_entry_group_is_empty (AvahiEntryGroup *group) { assert(group); client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); dbus_error_init(&error); @@ -409,7 +409,7 @@ int avahi_entry_group_add_service_strlst( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); if (!domain) @@ -528,7 +528,7 @@ int avahi_entry_group_add_service_subtype( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); if (!domain) @@ -638,7 +638,7 @@ int avahi_entry_group_update_service_txt_strlst( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); if (!domain) @@ -700,8 +700,6 @@ fail: dbus_message_unref(reply); return r; - - } /** Add a host/address pair */ @@ -726,7 +724,7 @@ int avahi_entry_group_add_address( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); dbus_error_init(&error); @@ -815,7 +813,7 @@ int avahi_entry_group_add_record( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); dbus_error_init(&error);