kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately
@ 2016-11-15 14:45 Radim Krčmář
  2016-11-15 14:47 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Radim Krčmář @ 2016-11-15 14:45 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Andrew Jones

Not doing so hid stderr output when the test was stuck and subsequently
killed with ^C.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 v2: use /dev/... files instead of &${file descriptor numbers} [Paolo]
---
 scripts/arch-run.bash | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 8e75c6ed6e17..0a1ae95396f9 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -30,12 +30,11 @@ run_qemu ()
 
 	# stdout to {stdout}, stderr to $errors
 	exec {stdout}>&1
-	errors=$("${@}" 2>&1 1>&${stdout})
+	errors=$("${@}" 2> >(tee /dev/stderr) > /dev/fd/$stdout)
 	ret=$?
 	exec {stdout}>&-
 
 	if [ "$errors" ]; then
-		printf "%s\n" "$errors" >&2
 		sig=$(grep 'terminating on signal' <<<"$errors")
 		if [ "$sig" ]; then
 			sig=$(sed 's/.*terminating on signal \([0-9][0-9]*\).*/\1/' <<<"$sig")
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-15 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15 14:45 [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately Radim Krčmář
2016-11-15 14:47 ` Paolo Bonzini
2016-11-15 14:51   ` Radim Krčmář

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).