summaryrefslogtreecommitdiffstats
path: root/avahi-client/entrygroup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-11-08 21:56:28 +0000
committerLennart Poettering <lennart@poettering.net>2005-11-08 21:56:28 +0000
commit6ecd227ceadc32ed229246aa61df6361c7b58a95 (patch)
tree95a9f35ccc096839faba3aa22afe07e9743d18a3 /avahi-client/entrygroup.c
parent0d787cfca3b6e2c0755a54ca732a85e15756aa57 (diff)
* add new flags parameter to avahi_client_new()
* introduce flags AVAHI_CLIENT_NO_FAIL and AVAHI_CLIENT_IGNORE_USER_CONFIG * beef up avahi-browse to show how AVAHI_CLIENT_NO_FAIL may be used: add a new parameter "-f" which tells avahi-browse to stay running when the daemon disconnects from DBUS and reconnect when it reappears. For now dbus-daemon restarts are not handled and result in an AVAHI_CLIENT_FAIL event. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@937 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-client/entrygroup.c')
-rw-r--r--avahi-client/entrygroup.c20
1 files changed, 10 insertions, 10 deletions
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);