X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-discover-standalone%2Fmain.c;h=296b56db59405c460494cf3b33ccdad911939e31;hb=0e203251414d56b3f6b8d4dafde19a1d27b18caf;hp=c6e9cc47e1a43bec4c919fac9c9e630f5c68ee88;hpb=dab307a583fcacdb0703e451f4f854f540fc8ec1;p=catta diff --git a/avahi-discover-standalone/main.c b/avahi-discover-standalone/main.c index c6e9cc4..296b56d 100644 --- a/avahi-discover-standalone/main.c +++ b/avahi-discover-standalone/main.c @@ -30,10 +30,14 @@ #include #include + #include #include + #include #include +#include + #include #include @@ -312,13 +316,11 @@ static void service_resolver_callback( return; } - if (event == AVAHI_RESOLVER_TIMEOUT) - gtk_label_set_markup(info_label, "Failed to resolve: Timeout."); - else if (event == AVAHI_RESOLVER_FAILURE) - gtk_label_set_markup(info_label, "Failed to resolve: Failure."); - else if (event == AVAHI_RESOLVER_NOT_FOUND) - gtk_label_set_markup(info_label, "Failed to resolve: Not found."); - else if (event == AVAHI_RESOLVER_FOUND) + if (event == AVAHI_RESOLVER_FAILURE) { + char t[256]; + snprintf(t, sizeof(t), "Failed to resolve: %s.", avahi_strerror(avahi_server_errno(server))); + gtk_label_set_markup(info_label, t); + } else if (event == AVAHI_RESOLVER_FOUND) update_label(s, host_name, a, port, txt); }