OSDN Git Service

* lib/remote.exp (local_exec, standard_close): Use SHELL
authorcagney <cagney>
Thu, 15 Nov 2001 02:29:56 +0000 (02:29 +0000)
committercagney <cagney>
Thu, 15 Nov 2001 02:29:56 +0000 (02:29 +0000)
background instead of tcl background to background the kill
processes.  Work around problem found by Nick Duffek in older
CYGWINs.

dejagnu/ChangeLog
dejagnu/lib/remote.exp

index d8b2f00..abb8e08 100644 (file)
@@ -1,3 +1,10 @@
+2001-11-12  Andrew Cagney  <ac131313@redhat.com>
+
+       * lib/remote.exp (local_exec, standard_close): Use SHELL
+       background instead of tcl background to background the kill
+       processes.  Work around problem found by Nick Duffek in older
+       CYGWINs.
+
 2001-10-10  Frank Ch. Eigler  <fche@redhat.com>
 
        * config/sid.exp (set_host_info): New proc.  Call it to set
index 5525e58..70969e7 100644 (file)
@@ -179,7 +179,10 @@ proc local_exec { commandline inp outp timeout } {
     # command in order to execute the execution. (English. Gotta love it.)
     if { ! $got_eof } {
        verbose "killing $pid $pgid";
-       exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid)" &;
+       # This is very, very nasty. SH, instead of EXPECT, is used to
+       # run this in the background since, on older CYGWINs, a
+       # strange file I/O error occures.
+       exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &";
     }
     # This will hang if the kill doesn't work. Nothin' to do, and it's not ok.
     catch "close -i $spawn_id";
@@ -314,10 +317,11 @@ proc standard_close { host } {
        }
        if { $pid > 0 } {
            verbose "doing kill, pid is $pid";
-           # This is very, very nasty. Then again, if after did something
-           # reasonable...
+           # This is very, very nasty. SH, instead of EXPECT, is used
+           # to run this in the background since, on older CYGWINs, a
+           # strange file I/O error occures.
            set pgid "-[join $pid { -}]";
-           exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid)" &;
+           exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &";
        }
        verbose "pid is $pid";
        catch "close -i $shell_id";