In FORK, flush output ports inside the narrowed section, not before,

avoiding some, erm, pretty obvious race condition.
This commit is contained in:
sperber 2003-03-07 13:38:07 +00:00
parent a51ba12623
commit 1e1d44a497
1 changed files with 4 additions and 1 deletions

View File

@ -1065,7 +1065,6 @@
;;; Assumes niladic primitive %%FORK.
(define (fork . stuff)
(flush-all-ports)
(apply fork-1 #t stuff))
(define (%fork . stuff)
@ -1104,6 +1103,10 @@
(lambda (thunk) (thunk)))))
(maybe-narrow
(lambda ()
(if clear-interactive?
(flush-all-ports))
;; There was an atomicity problem/race condition -- if a child
;; process died after it was forked, but before the scsh fork
;; procedure could register the child's procobj in the