X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-client%2Fentrygroup.c;h=003b17cfd5cc309c92063721741e44cf09c46d8a;hb=6ecd227ceadc32ed229246aa61df6361c7b58a95;hp=4c5c91444098c46ada2d2964818f113fdc8a7cfa;hpb=0d787cfca3b6e2c0755a54ca732a85e15756aa57;p=catta diff --git a/avahi-client/entrygroup.c b/avahi-client/entrygroup.c index 4c5c914..003b17c 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_FAILURE) { + 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_FAILURE) + 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_FAILURE) + 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_FAILURE) + 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_FAILURE) + 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_FAILURE) + 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_FAILURE) + 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_FAILURE) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); if (!domain) @@ -726,7 +726,7 @@ int avahi_entry_group_add_address( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_FAILURE) + 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 +815,7 @@ int avahi_entry_group_add_record( client = group->client; - if (!group->path || group->client->state == AVAHI_CLIENT_FAILURE) + if (!group->path || !avahi_client_is_connected(group->client)) return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE); dbus_error_init(&error);