From 79ecd59b10cf029426ea67f2f742a7aaf14150be Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 7 Sep 2023 17:30:26 +0300 Subject: [PATCH] Flush STDOUT and STDERR before exiting from cli to fix Proxmox "Unexpected result" --- src/cli.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cli.cpp b/src/cli.cpp index dbfd993b..f35febb7 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -357,6 +357,8 @@ static int run(cli_tool_t *p, json11::Json::object cfg) p->ringloop = NULL; } // Print result + fflush(stderr); + fflush(stdout); if (p->json_output && !result.data.is_null()) { printf("%s\n", result.data.dump().c_str());