After fork/pipe, make the ports returned by the pipe the

current-in/output-ports. This corresponds to the intended semantics of
side-effecting the standard ports and tells the GC that the ports are
alive.
This commit is contained in:
mainzelm 2003-07-21 12:02:55 +00:00
parent b036a6da1c
commit 9d93d5a61e
1 changed files with 8 additions and 4 deletions

View File

@ -36,12 +36,16 @@
(let ((proc (forker #f no-new-command-level?))) (let ((proc (forker #f no-new-command-level?)))
(cond (proc ; Parent (cond (proc ; Parent
(close w) (close w)
(move->fdes r 0)) (move->fdes r 0)
(set-current-input-port! r))
(else ; Child (else ; Child
(close r) (close r)
(move->fdes w 1) (move->fdes w 1)
(if maybe-thunk (if maybe-thunk
(call-terminally maybe-thunk)))) (with-current-output-port
w
(call-terminally maybe-thunk))
(set-current-output-port! w))))
proc)))) proc))))