summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2005-08-23 17:38:22 +0000
committerTrent Lloyd <lathiat@bur.st>2005-08-23 17:38:22 +0000
commit1d6cecfe69fa2faea1c81ccd899bac24aad64273 (patch)
treeaba6cc51cceaa5f109fa25cc8d5f3d832883b955
parent64064fb2d79d7b8539a5e1c2c13592b74da03544 (diff)
* Move the D-BUS configured but not compiled in warning, and make it work right.
* Fix a bug in avahi-client where if you have multiple clients, a crash can occur when using AvahiServiceBrowsers. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@424 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--avahi-client/browser.c3
-rw-r--r--avahi-daemon/main.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/avahi-client/browser.c b/avahi-client/browser.c
index 5de4824..9a7438e 100644
--- a/avahi-client/browser.c
+++ b/avahi-client/browser.c
@@ -573,6 +573,9 @@ DBusHandlerResult avahi_service_browser_event (AvahiClient *client, AvahiBrowser
if (strcmp (b->path, path) == 0)
break;
+ if (!b)
+ goto fail;
+
if (!dbus_message_get_args (
message, &error,
DBUS_TYPE_INT32, &interface,
diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c
index 6110cbc..9f7b847 100644
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -394,10 +394,6 @@ static int load_config_file(DaemonConfig *c) {
} else {
c->enable_dbus = 0;
}
-#ifdef HAVE_DBUS
- if (c->enable_dbus == 1)
- avahi_log_warn("Avahi was compiled without d-bus support but you requested it was enabled in the config file");
-#endif
}
else if (strcasecmp(p->key, "drop-root") == 0)
c->drop_root = is_yes(p->value);
@@ -601,9 +597,8 @@ static int run_server(DaemonConfig *c) {
if (simple_protocol_setup(poll_api) < 0)
goto finish;
-
+ if (c->enable_dbus) {
#ifdef HAVE_DBUS
- if (c->enable_dbus)
if (dbus_protocol_setup(poll_api) < 0) {
if (c->fail_on_missing_dbus)
@@ -612,7 +607,10 @@ static int run_server(DaemonConfig *c) {
avahi_log_warn("WARNING: Failed to contact D-BUS daemon, disabling D-BUS support.");
c->enable_dbus = 0;
}
+#else
+ avahi_log_warn("WARNING: We are configured to enable D-BUS but it was not compiled in");
#endif
+ }
load_resolv_conf(c);
static_service_load();