summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-07-09 13:49:58 +0000
committerLennart Poettering <lennart@poettering.net>2006-07-09 13:49:58 +0000
commit44f721610073c9ce55ace4792fa6a8ae18dc7f6f (patch)
treec92319697540a4e10c84dd1744bab94bb37d7eec
parentb200e9bab1ec8a398e07d4e3dc7698aa8b84bc6a (diff)
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
-rw-r--r--avahi-utils/avahi-browse.c2
1 files changed, 2 insertions, 0 deletions
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) {