From 19014c1521f83f2d3e0db1aa27378c9888c03298 Mon Sep 17 00:00:00 2001 From: Thomas Cort Date: Wed, 29 Apr 2015 13:33:53 -0400 Subject: [PATCH] ITS#8118 dosearch: flush stdout The LDIF output wasn't being explicitly flushed. In certain scenarios, such as piping the output of a persistent ldapsearch to node.js v0.12 on Mac OS X 10.10.3, the output is unavailable to the process consuming the search results until the stdio buffer fills (8192 bytes for example). This can leave the tail end of persistent search results in the buffer for a long time (until enough output has accumulated). Explicitly call flush so that the output is immediately available. --- clients/tools/ldapsearch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index c98444f781..e20eba2b5b 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -1537,6 +1537,7 @@ static int dosearch( } ldap_msgfree( res ); + fflush( stdout ); } done: -- 2.39.5