Make sure we keep the old value of timeout set properly.
authorBob Manson <manson@cygnus>
Fri, 23 May 1997 06:15:46 +0000 (06:15 +0000)
committerBob Manson <manson@cygnus>
Fri, 23 May 1997 06:15:46 +0000 (06:15 +0000)
gdb/testsuite/lib/gdb.exp

index 4a55850367fd9c2509ddd8bab872b39a169c033b..0a44f6d580f91d1ab3df23ecf051a96ac2f2837f 100644 (file)
@@ -857,14 +857,18 @@ proc gdb_expect { args } {
     upvar timeout timeout
     if [target_info exists gdb,timeout] {
        if [info exists timeout] {
-           set oldt $timeout
+           set oldt $timeout;
+           if { $timeout < [target_info gdb,timeout] } {
+               set timeout [target_info gdb,timeout];
+           }
+       } else {
+           set timeout [target_info gdb,timeout];
        }
-       set timeout [target_info gdb,timeout];
     }
     set code [catch {uplevel remote_expect host $args} string];
     if [target_info exists gdb,timeout] {
        if [info exists oldt] {
-           set timeout oldt
+           set timeout $oldt
        } else {
            unset timeout
        }