X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fmain.c;h=480753e59a14cbb036aed066a6fbd9ab2eda3296;hb=e63a65b3955b173a3e8d6b78c6377a518a9922d6;hp=1083416811bcb5625799852bb0f544e058461d0c;hpb=3a625af272ee8c6f878ba4d44ed1c741a1582395;p=catta diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index 1083416..480753e 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -150,6 +150,7 @@ static AvahiEntryGroup* add_dns_servers(AvahiServer *s, AvahiEntryGroup* g, gcha else if (avahi_server_add_dns_server_address(s, g, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, &a, 53) < 0) { avahi_entry_group_free(g); + avahi_log_error("Failed to add DNS server address: %s", avahi_strerror(avahi_server_errno(s))); return NULL; } } @@ -500,6 +501,7 @@ static gint run_server(DaemonConfig *c) { gint r = -1; GIOChannel *io = NULL; guint watch_id = (guint) -1; + gint error; g_assert(c); @@ -527,17 +529,19 @@ static gint run_server(DaemonConfig *c) { goto finish; #endif - if (!(avahi_server = avahi_server_new(NULL, &c->server_config, server_callback, c))) + if (!(avahi_server = avahi_server_new(NULL, &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) { + if (c->daemonize) daemon_retval_send(0); - r = 0; - } + + r = 0; g_main_loop_run(loop); @@ -554,7 +558,6 @@ finish: dbus_protocol_shutdown(); #endif - if (avahi_server) avahi_server_free(avahi_server);