Flush STDOUT and STDERR before exiting from cli to fix Proxmox "Unexpected result"

This commit is contained in:
Vitaliy Filippov
2023-09-17 00:36:46 +03:00
parent aff6f3e970
commit 9afa200a33
+2
View File
@@ -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());