aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2016-04-07 16:57:08 +1000
committerBen Elliston <bje@gnu.org>2016-04-07 16:57:08 +1000
commita5fe563337dd18f64a9e291764d6ddf16d681578 (patch)
treef6066e30f713bd6a3bf2837b34bdb726c6c22e89
parent1de22bf567be9b0a1d9a2a9066f2f7e2f02563f4 (diff)
downloaddejagnu-a5fe563337dd18f64a9e291764d6ddf16d681578.zip
dejagnu-a5fe563337dd18f64a9e291764d6ddf16d681578.tar.gz
dejagnu-a5fe563337dd18f64a9e291764d6ddf16d681578.tar.bz2
* lib/remote.exp (remote_exec): Join cd $remotedir and $program on
the command line with ';' and not &&.
-rw-r--r--ChangeLog5
-rw-r--r--lib/remote.exp6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ac70ce..5ecb8d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2016-04-07 Ben Elliston <bje@gnu.org>
+ * lib/remote.exp (remote_exec): Join cd $remotedir and $program on
+ the command line with ';' and not &&.
+
+2016-04-07 Ben Elliston <bje@gnu.org>
+
Reported by Faraz Shahbazker.
* doc/dejagnu.texi (rsh_exec procedure): Fix broken @node.
diff --git a/lib/remote.exp b/lib/remote.exp
index 2b9a4da..fea11cf 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -314,7 +314,11 @@ proc remote_exec { hostname program args } {
} else {
if { [board_info $hostname exists remotedir] } {
set remotedir [board_info $hostname remotedir]
- set program "test -d $remotedir && cd $remotedir && $program"
+ # This is a bit too clever. Join cd $remotedir and
+ # $program on the command line with ';' and not '&&'. When
+ # called, $program may be mkdir to initially create the
+ # remote directory, in which case cd would fail.
+ set program "test -d $remotedir && cd $remotedir; $program"
}
set result [call_remote "" exec $hostname $program $pargs $inp $outp]
}