ipfire-3.x/dejagnu/patches/dejagnu-1.4.4-smp-1.patch

27 lines
1.2 KiB
Diff

--- dejagnu-1.4.4/lib/remote.exp.smp 2003-10-10 23:42:46.000000000 -0700
+++ dejagnu-1.4.4/lib/remote.exp 2005-08-05 12:32:10.107161990 -0700
@@ -91,9 +91,13 @@ proc local_exec { commandline inp outp t
# 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. On
+ # SMP machine, close the connection may send SIGHUP to the child
+ # and cause it to exit before it can exit normally. We should make
+ # the child to ignore SIGHUP.
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 {
@@ -134,7 +138,7 @@ proc local_exec { commandline inp outp t
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.