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:03:12 +00:00
parent a6aa3a65bc
commit a39c87e7d6
1 changed files with 8 additions and 4 deletions

View File

@ -230,12 +230,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-and-exit maybe-thunk)))) (with-current-output-port
w
(call-and-exit maybe-thunk))
(set-current-output-port! w))))
proc)))) proc))))