From: Lennart Poettering Date: Sun, 9 Jul 2006 13:49:58 +0000 (+0000) Subject: flush stdout after every line, this makes avahi-browse more useful in shell scripts... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=44f721610073c9ce55ace4792fa6a8ae18dc7f6f;p=catta flush stdout after every line, this makes avahi-browse more useful in shell scripts where pipes are involved (closes #48) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1232 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-utils/avahi-browse.c b/avahi-utils/avahi-browse.c index 7abd53e..9fd9927 100644 --- a/avahi-utils/avahi-browse.c +++ b/avahi-utils/avahi-browse.c @@ -148,6 +148,7 @@ static void print_service_line(Config *config, char c, AvahiIfIndex interface, A interface != AVAHI_IF_UNSPEC ? if_indextoname(interface, ifname) : "n/a", protocol != AVAHI_PROTO_UNSPEC ? avahi_proto_to_string(protocol) : "n/a", n_columns-35, name, type, domain); + fflush(stdout); } static void service_resolver_callback( @@ -206,6 +207,7 @@ static void service_resolver_callback( assert(n_resolving > 0); n_resolving--; check_terminate(i->config); + fflush(stdout); } static ServiceInfo *add_service(Config *c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain) {