chiark / gitweb /
mention msel
[chiark-tcl-applet.git] / applet.tcl
index 2bb9ac4452ec172e04845e57c6f8d59ad7b6971c..8a0193f47e3e518dff545bf7b9274857fb835ce1 100644 (file)
@@ -218,43 +218,3 @@ proc setupinnerwindow {w} {
 proc setimage {image} {
     .i configure -image $image
 }
-
-proc fork-then {ondeath inchild} {
-    global children errorCode errorInfo
-    foreach f {stdout stderr} {
-       if {[catch { flush $f } emsg]} {
-           catch { bgerror $emsg }
-       }
-    }
-    set pid [fork]
-    if {!$pid} { 
-       if {[catch { 
-           uplevel 1 $inchild
-       } emsg]} {
-           puts stderr "CHILD ERROR $emsg\n$errorCode\n$errorInfo\n"
-       }
-       kill KILL [id process]
-    }
-    set children($pid) $ondeath
-    return $pid
-}
-
-proc chld-handler {} {
-    global children
-    while 1 {
-       if {[catch { set got [wait -nohang] }]} break
-       if {![llength $got]} break
-       manyset $got pid how how2
-       if {[info exists children($pid)]} {
-           set l $children($pid)
-           unset children($pid)
-           if {[catch {
-               uplevel #0 [concat [list $l] $how $how2]
-           } emsg]} {
-               catch { bgerror $emsg }
-           }
-       }
-    }  
-}
-
-signal -restart trap CHLD { after idle chld-handler }