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

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