--- dejagnu-1.4.4/lib/rsh.exp 2003-10-11 08:42:46.000000000 +0200 +++ dejagnu-1.4.4/lib/rsh.exp.fixed 2008-05-28 13:56:51.855960000 +0200 @@ -22,7 +22,6 @@ # proc rsh_open { hostname } { global spawn_id - set tries 0 set result -1 @@ -233,14 +232,20 @@ proc rsh_exec { boardname cmd args } { set pargs [lindex $args 0] if { [llength $args] > 1 } { set inp [lindex $args 1] + if { [llength $args] > 2 } { + set outp [lindex $args 2] + } else { + set outp "" + } } else { set inp "" + set outp "" } } else { set pargs "" set inp "" + set outp "" } - verbose "Executing $boardname:$cmd $pargs < $inp" if ![board_info $boardname exists rsh_prog] { @@ -277,7 +282,11 @@ proc rsh_exec { boardname cmd args } { set inp "/dev/null" } - set status [catch "exec cat $inp | $RSH $rsh_useropts $hostname sh -c '$cmd $pargs \\; echo XYZ\\\${?}ZYX' |& cat" output] + if { $outp != "" } { + set outp "> $outp" + } + + set status [catch "exec cat $inp | $RSH $rsh_useropts $hostname sh -c '$cmd $pargs \\; echo XYZ\\\${?}ZYX' $outp |& cat" output] verbose "$RSH output is $output" # `status' doesn't mean much here other than rsh worked ok. # What we want is whether $cmd ran ok.