s4-ldb: make ldb tools line buffered
authorAndrew Tridgell <tridge@samba.org>
Fri, 20 Nov 2009 00:33:43 +0000 (11:33 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 20 Nov 2009 00:34:39 +0000 (11:34 +1100)
this prevents output being buffered when redirected to a file. Useful
for larger ldb command line operations

source4/lib/ldb/tools/cmdline.c

index 8f610f77050adb3d5301b839c89ab35ac8d3ff36..f0cd0a3a60c3b93bac0934dc24abfd4ceca652e4 100644 (file)
@@ -99,6 +99,9 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb,
 
 #endif
 
+       /* make the ldb utilities line buffered */
+       setlinebuf(stdout);
+
        ret = talloc_zero(ldb, struct ldb_cmdline);
        if (ret == NULL) {
                fprintf(stderr, "Out of memory!\n");