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

hotfix-1.0.0
Vitaliy Filippov 2023-09-07 17:30:26 +03:00
parent aff6f3e970
commit 9afa200a33
1 changed files with 2 additions and 0 deletions

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());