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

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