]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: properly interleave shared stdout and stderr
authorEric Blake <eblake@redhat.com>
Fri, 19 Aug 2011 15:20:35 +0000 (09:20 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Aug 2011 15:22:22 +0000 (09:22 -0600)
commitbaac9c37d778cee455ce8d49f95ad2d88770c34c
treea1c8f11e29aa48a82586c6ffdf10c76f39a0fcae
parentd89dd42d51679cd73932f8dc9472549bb1265ac4
virsh: properly interleave shared stdout and stderr

Without this patch, invoking 'virsh >file 2>&1' results in
error messages appearing before normal output, even if they
occurred later in time than the normal output (since stderr
is unbuffered, but stdout waits until a full buffer).

* tools/virsh.c (print_job_progress, vshError): Flush between
stream transitions.
* tests/undefine: Test it.
tests/undefine
tools/virsh.c