From d9b2a10ee0abd09a77f36e2b05e933a8b480bea9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 28 Mar 2005 16:20:14 +0000 Subject: [PATCH] . original commit: 2691f0791980408f32f3c38142b6ff0a64baab62 --- collects/mzlib/process.ss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collects/mzlib/process.ss b/collects/mzlib/process.ss index 44de233..a29fe9f 100644 --- a/collects/mzlib/process.ss +++ b/collects/mzlib/process.ss @@ -88,6 +88,11 @@ [se (streamify-out cerr err #t)] [aport (lambda (x) (and (port? x) x))]) + (when (thread? si) + ;; Wait for process to end, then stop copying input: + (thread (lambda () + (sync subp) + (break-thread si)))) (list (aport so) (aport si) (subprocess-pid subp) @@ -107,7 +112,7 @@ (when (thread? t) (thread-wait t)))]) (twait so) - ;; (twait si) - if the process didn't wait, we don't need to! + (twait si) (twait se))) ((interrupt) (subprocess-kill subp #f)) ((kill) (subprocess-kill subp #t))