summaryrefslogtreecommitdiffstats
path: root/avahi-daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-14 03:13:28 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-14 03:13:28 +0000
commitfd709eb188a6ec65026c3dab3a08abaf252bac85 (patch)
treef384e4f78f8be9c43b1fb7889241bcf0309f3230 /avahi-daemon
parent5e9d4f12153a28fa85609724b6c5161712e12ef3 (diff)
Fix no network interface bug reported by Lathiat
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@316 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon')
-rw-r--r--avahi-daemon/main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c
index 843ee2b..e9030aa 100644
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -193,6 +193,11 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void *userda
g_assert(s);
g_assert(c);
+ /** This function is possibly called before the global variable
+ * avahi_server has been set, therefore we do it explicitly */
+
+ avahi_server = s;
+
#ifdef ENABLE_DBUS
if (c->enable_dbus)
dbus_protocol_server_state_changed(state);
@@ -624,14 +629,14 @@ static gint run_server(DaemonConfig *c) {
goto finish;
#endif
+ load_resolv_conf(c);
+ static_service_load();
+
if (!(avahi_server = avahi_server_new(avahi_glib_poll_get(poll_api), &c->server_config, server_callback, c, &error))) {
avahi_log_error("Failed to create server: %s", avahi_strerror(error));
goto finish;
}
- load_resolv_conf(c);
-
- static_service_load();
if (c->daemonize)
daemon_retval_send(0);
@@ -968,7 +973,7 @@ int main(int argc, char *argv[]) {
chdir("/");
- avahi_log_info("%s "PACKAGE_VERSION" starting up.\n", argv0);
+ avahi_log_info("%s "PACKAGE_VERSION" starting up.", argv0);
if (run_server(&config) == 0)
r = 0;