diff options
author | Ben Elliston <bje@gnu.org> | 2011-03-15 10:07:50 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2011-03-15 10:07:50 +1100 |
commit | 50a378f626fcdbaf30202a36bf73738de08a53bf (patch) | |
tree | 9d8cb103c3b1ae77906e170cd5cf73f82cfdfc1b | |
parent | f13cc0cd29760a5c5bcd2f2d0e58b927e5e429da (diff) | |
download | dejagnu-50a378f626fcdbaf30202a36bf73738de08a53bf.zip dejagnu-50a378f626fcdbaf30202a36bf73738de08a53bf.tar.gz dejagnu-50a378f626fcdbaf30202a36bf73738de08a53bf.tar.bz2 |
2011-03-15 H.J. Lu <hjl.tools@gmail.com>
* lib/remote.exp (local_exec): Ignore SIGHUP.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/remote.exp | 10 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2011-03-15 H.J. Lu <hjl.tools@gmail.com> + + * lib/remote.exp (local_exec): Ignore SIGHUP. + 2011-03-14 Ben Elliston <bje@gnu.org> * runtest.exp (frame_version): Set to 1.5.1. diff --git a/lib/remote.exp b/lib/remote.exp index f0bf269..e270f85 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -86,11 +86,15 @@ proc local_exec { commandline inp outp timeout } { # doesn't assign process groups correctly and we can't reliably kill # programs that bear children. We can't use tcl's exec because it has # no way to timeout programs that hang. *sigh* - + # + # The expect command will close the connection when it sees + # EOF. Closing the connection may send SIGHUP to the child and + # cause it to exit before it can exit normally. The child should + # ignore SIGHUP. global errorInfo if { "$inp" == "" && "$outp" == "" } { set id -1 - set result [catch "eval spawn \{${commandline}\}" pid] + set result [catch "eval spawn -ignore SIGHUP \{${commandline}\}" pid] if { $result == 0 } { set result2 0 } else { @@ -130,7 +134,7 @@ proc local_exec { commandline inp outp timeout } { return [list -1 "open of $commandline $inp $outp failed: $errorInfo"] } set pid [pid $id] - set result [catch "spawn -leaveopen $id" result2] + set result [catch "spawn -ignore SIGHUP -leaveopen $id" result2] } # Prepend "-" to each pid, to generate the "process group IDs" needed by # kill. |