From: msweet Date: Fri, 7 Jun 2013 02:18:50 +0000 (+0000) Subject: Save work on ippfind for Linux. X-Git-Tag: release-1.7rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94b4b4a07d17fdcceba575f908b86c014d8baa52;p=thirdparty%2Fcups.git Save work on ippfind for Linux. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11028 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/test/ippfind.c b/test/ippfind.c index 5883060592..16967d9ca3 100644 --- a/test/ippfind.c +++ b/test/ippfind.c @@ -45,6 +45,7 @@ #define _CUPS_NO_DEPRECATED #include +#include #include #ifdef HAVE_DNSSD # include @@ -1160,8 +1161,8 @@ main(int argc, /* I - Number of command-line args */ #elif defined(HAVE_AVAHI) if ((avahi_poll = avahi_simple_poll_new()) == NULL) { - _cupsLangPrintError(stderr, _("ippfind: Unable to use Bonjour: %s"), - strerror(errno)); + _cupsLangPrintf(stderr, _("ippfind: Unable to use Bonjour: %s"), + strerror(errno)); return (IPPFIND_EXIT_BONJOUR); } @@ -1171,8 +1172,8 @@ main(int argc, /* I - Number of command-line args */ 0, client_callback, avahi_poll, &err); if (!client) { - _cupsLangPrintError(stderr, _("ippfind: Unable to use Bonjour: %s"), - dnssd_error_string(err)); + _cupsLangPrintf(stderr, _("ippfind: Unable to use Bonjour: %s"), + dnssd_error_string(err)); return (IPPFIND_EXIT_BONJOUR); } #endif /* HAVE_DNSSD */ @@ -1239,7 +1240,7 @@ main(int argc, /* I - Number of command-line args */ if (service->ref) err = 0; else - err = avahi_client_get_errno(avahi_client); + err = avahi_client_get_error(avahi_client); #endif /* HAVE_DNSSD */ } else @@ -1560,7 +1561,7 @@ browse_callback( fprintf(stderr, "DEBUG: browse_callback: %s\n", avahi_strerror(avahi_client_errno(client))); bonjour_error = 1; - avahi_simple_poll_quit(simple_poll); + avahi_simple_poll_quit(avahi_poll); break; case AVAHI_BROWSER_NEW: @@ -2488,10 +2489,8 @@ poll_callback( val = poll(pollfds, num_pollfds, 500); - if (val < 0) - fprintf(stderr, "DEBUG: poll_callback: %s\n", strerror(errno)); - else if (val > 0) - got_data = 1; + if (val > 0) + avahi_got_data = 1; return (val); }