flush stdout after every line, this makes avahi-browse more useful in shell scripts...
authorLennart Poettering <lennart@poettering.net>
Sun, 9 Jul 2006 13:49:58 +0000 (13:49 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 9 Jul 2006 13:49:58 +0000 (13:49 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1232 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-utils/avahi-browse.c

index 7abd53e..9fd9927 100644 (file)
@@ -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) {