From c0721121e0268de2a0604974b5e93c41b7cf1024 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Fri, 28 Sep 2018 08:26:02 +0000 Subject: Combine remote stderr into remote stdout * lib/ssh.exp (ssh_exec): Redirect stderr to stdout on the remote machine, to avoid race conditions. --- lib/ssh.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ssh.exp b/lib/ssh.exp index a72f794..3c7b840 100644 --- a/lib/ssh.exp +++ b/lib/ssh.exp @@ -171,7 +171,7 @@ proc ssh_exec { boardname program pargs inp outp } { # We use && here, as otherwise the echo always works, which makes it look # like execution succeeded when in reality it failed. - set ret [local_exec "$SSH $ssh_useropts $ssh_user$hostname sh -c '$program $pargs && echo XYZ\\\${?}ZYX \\; rm -f $program'" $inp $outp $timeout] + set ret [local_exec "$SSH $ssh_useropts $ssh_user$hostname sh -c '$program $pargs 2>&1 && echo XYZ\\\${?}ZYX \\; rm -f $program'" $inp $outp $timeout] set status [lindex $ret 0] set output [lindex $ret 1] -- cgit v1.1