output_buffer: only realloc once, and memset just what we need
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index ee6eae24c91acd14fc72884b700fd801fb31246e..bafbd48e7ae35c00782af205308ce89a8c665d4e 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -42,6 +42,12 @@ int main(int argc, char *argv[], char *envp[])
        if (parse_options(argc, argv))
                goto done;
 
+       /*
+        * line buffer stdout to avoid output lines from multiple
+        * threads getting mixed
+        */
+       setvbuf(stdout, NULL, _IOLBF, 0);
+
        fio_time_init();
 
        if (nr_clients) {