[PATCH] virsh: fflush(stdout) after fputs()

Ján Tomko jtomko at redhat.com
Thu Mar 10 07:30:55 UTC 2022


On a Wednesday in 2022, Michal Privoznik wrote:
>We are not guaranteed that the string we are printing onto stdout
>contains '\n' and thus that the stdout is flushed. In fact, I've
>met this problem when virsh asked me whether I want to edit the
>domain XML again (vshAskReedit()) but the prompt wasn't displayed
>(as it does not contain a newline character) and virsh just sat
>there waiting for my input, I sat there waiting for virsh's
>output. Flush stdout after all fputs()-s  which do not flush
>stdout.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tools/vsh.c | 4 ++++
> 1 file changed, 4 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220310/6973ac16/attachment.sig>


More information about the libvir-list mailing list