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:
parent
b036a6da1c
commit
9d93d5a61e
|
@ -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))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue