Flush STDOUT and STDERR before exiting from cli to fix Proxmox "Unexpected result"
This commit is contained in:
@@ -357,6 +357,8 @@ static int run(cli_tool_t *p, json11::Json::object cfg)
|
|||||||
p->ringloop = NULL;
|
p->ringloop = NULL;
|
||||||
}
|
}
|
||||||
// Print result
|
// Print result
|
||||||
|
fflush(stderr);
|
||||||
|
fflush(stdout);
|
||||||
if (p->json_output && !result.data.is_null())
|
if (p->json_output && !result.data.is_null())
|
||||||
{
|
{
|
||||||
printf("%s\n", result.data.dump().c_str());
|
printf("%s\n", result.data.dump().c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user