Blame SOURCES/0022-common-mltools-make-sure-machine-readable-output-is-.patch

da373f
From d60ef2eca9c0e51944a9c17806d6936af45907f5 Mon Sep 17 00:00:00 2001
3efd08
From: Pino Toscano <ptoscano@redhat.com>
3efd08
Date: Fri, 22 Mar 2019 11:36:41 +0100
3efd08
Subject: [PATCH] common/mltools: make sure machine readable output is flushed
3efd08
3efd08
Enhance the helper printf function for machine readable output to always
3efd08
flush after each string: this way, readers of the machine readable
3efd08
stream can get the output as soon as it is outputted.
3efd08
3efd08
(cherry picked from commit abf1607f46ddc3d829a3688b9499a9bcd2319d19)
3efd08
---
3efd08
 common/mltools/tools_utils.ml | 6 +++++-
3efd08
 1 file changed, 5 insertions(+), 1 deletion(-)
3efd08
3efd08
diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
3efd08
index 5a35708cd..ade4cb37f 100644
3efd08
--- a/common/mltools/tools_utils.ml
3efd08
+++ b/common/mltools/tools_utils.ml
3efd08
@@ -59,7 +59,11 @@ let machine_readable () =
3efd08
   | None -> None
3efd08
   | Some chan ->
3efd08
     let pr fs =
3efd08
-      ksprintf (output_string chan) fs
3efd08
+      let out s =
3efd08
+        output_string chan s;
3efd08
+        flush chan
3efd08
+      in
3efd08
+      ksprintf out fs
3efd08
     in
3efd08
     Some { pr }
3efd08
 
3efd08
-- 
da373f
2.18.4
3efd08