75 |
# the kill command will be invoked. |
# the kill command will be invoked. |
76 |
# |
# |
77 |
proc local_exec { commandline inp outp timeout } { |
proc local_exec { commandline inp outp timeout } { |
78 |
# TCL's exec is a pile of crap. It does two very inappropriate things |
# Tcl's exec is a pile of crap. It does two very inappropriate things |
79 |
# firstly, it has no business returning an error if the program being |
# firstly, it has no business returning an error if the program being |
80 |
# executed happens to write to stderr. Secondly, it appends its own |
# executed happens to write to stderr. Secondly, it appends its own |
81 |
# error messages to the output of the command if the process exits with |
# error messages to the output of the command if the process exits with |
111 |
} |
} |
112 |
|
|
113 |
set use_tee 0 |
set use_tee 0 |
114 |
# We add |& cat so that TCL exec doesn't freak out if the |
# We add |& cat so that Tcl exec doesn't freak out if the |
115 |
# program writes to stderr. |
# program writes to stderr. |
116 |
if { $outp == "" } { |
if { $outp == "" } { |
117 |
set outp "|& cat" |
set outp "|& cat" |
175 |
|
|
176 |
# Uuuuuuugh. Now I'm getting really sick. |
# Uuuuuuugh. Now I'm getting really sick. |
177 |
# If we didn't get an EOF, we have to kill the poor defenseless program. |
# If we didn't get an EOF, we have to kill the poor defenseless program. |
178 |
# However, TCL has no kill primitive, so we have to execute an external |
# However, Tcl has no kill primitive, so we have to execute an external |
179 |
# command in order to execute the execution. (English. Gotta love it.) |
# command in order to execute the execution. (English. Gotta love it.) |
180 |
if { ! $got_eof } { |
if { ! $got_eof } { |
181 |
verbose "killing $pid $pgid" |
verbose "killing $pid $pgid" |