Blame SOURCES/dejagnu-1.5-smp-1.patch

bb3429
diff -up dejagnu-1.5/lib/remote.exp.smp-1 dejagnu-1.5/lib/remote.exp
bb3429
--- dejagnu-1.5/lib/remote.exp.smp-1	2011-03-22 14:51:40.962914270 +0100
bb3429
+++ dejagnu-1.5/lib/remote.exp	2011-03-22 14:54:36.152608589 +0100
bb3429
@@ -86,11 +86,16 @@ proc local_exec { commandline inp outp t
bb3429
     # doesn't assign process groups correctly and we can't reliably kill
bb3429
     # programs that bear children. We can't use tcl's exec because it has
bb3429
     # no way to timeout programs that hang. *sigh*
bb3429
+    #
bb3429
+    # The expect command will close the connection when it sees EOF. On
bb3429
+    # SMP machine, close the connection may send SIGHUP to the child
bb3429
+    # and cause it to exit before it can exit normally.  We should make
bb3429
+    # the child to ignore SIGHUP.
bb3429
 
bb3429
     global errorInfo
bb3429
     if { "$inp" == "" && "$outp" == "" } {
bb3429
 	set id -1
bb3429
-	set result [catch "eval spawn \{${commandline}\}" pid]
bb3429
+	set result [catch "eval spawn -ignore SIGHUP \{${commandline}\}" pid]
bb3429
 	if { $result == 0 } {
bb3429
 	    set result2 0
bb3429
 	} else {
bb3429
@@ -130,7 +135,7 @@ proc local_exec { commandline inp outp t
bb3429
 	    return [list -1 "open of $commandline $inp $outp failed: $errorInfo"]
bb3429
 	}
bb3429
 	set pid [pid $id]
bb3429
-	set result [catch "spawn -leaveopen $id" result2]
bb3429
+	set result [catch "spawn -ignore SIGHUP -leaveopen $id" result2]
bb3429
     }
bb3429
     # Prepend "-" to each pid, to generate the "process group IDs" needed by
bb3429
     # kill.