aboutsummaryrefslogtreecommitdiff
path: root/tclcompat.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-05-27 11:54:01 +1000
committerSteve Bennett <steveb@workware.net.au>2011-05-27 12:03:55 +1000
commit3677af61ae8837760f80005eff9e15ab54a4343d (patch)
tree82349832eb0740dabebd4ead8a1e78662440f320 /tclcompat.tcl
parent31ddb64b8eb6803d25f990760d73afa4cfcea3b7 (diff)
downloadjimtcl-3677af61ae8837760f80005eff9e15ab54a4343d.zip
jimtcl-3677af61ae8837760f80005eff9e15ab54a4343d.tar.gz
jimtcl-3677af61ae8837760f80005eff9e15ab54a4343d.tar.bz2
closing an 'open |...' filehandle should wait
for the detached child processes to complete. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tclcompat.tcl')
-rw-r--r--tclcompat.tcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/tclcompat.tcl b/tclcompat.tcl
index 9496f46..262aae8 100644
--- a/tclcompat.tcl
+++ b/tclcompat.tcl
@@ -146,6 +146,12 @@ proc popen {cmd {mode r}} {
if {$cmd eq "pid"} {
return $pids
}
+ if {$cmd eq "close"} {
+ $f close
+ # And wait for the child processes to complete
+ foreach p $pids { os.wait $p }
+ return
+ }
tailcall $f $cmd {*}$args
}
} on error {error opts} {