]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/main.c
* drop glib from avahi-common
[catta] / avahi-daemon / main.c
index 1083416811bcb5625799852bb0f544e058461d0c..480753e59a14cbb036aed066a6fbd9ab2eda3296 100644 (file)
@@ -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);