Skip to content
Snippets Groups Projects
Commit 12eafbec authored by wlott's avatar wlott
Browse files

Fixed COPY-DESCRIPTOR-TO-STREAM to set a flag when it closes the descriptor

and to check this flag before it selects.  This way, if we recursively
enter the handler (due to write-string calling something that calls
serve-event), then we won't blow out when we unwind.
parent 506e07c6
No related branches found
No related tags found
Loading
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/run-program.lisp,v 1.4 1991/06/17 17:35:28 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/run-program.lisp,v 1.5 1991/06/17 20:31:44 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -535,6 +535,8 @@ ...@@ -535,6 +535,8 @@
#'(lambda (fd) #'(lambda (fd)
(declare (ignore fd)) (declare (ignore fd))
(loop (loop
(unless handler
(return))
(multiple-value-bind (multiple-value-bind
(result readable/errno) (result readable/errno)
(mach:unix-select (1+ descriptor) (ash 1 descriptor) (mach:unix-select (1+ descriptor) (ash 1 descriptor)
...@@ -553,11 +555,13 @@ ...@@ -553,11 +555,13 @@
(eql errno mach:eio)) (eql errno mach:eio))
(eql count 0)) (eql count 0))
(system:remove-fd-handler handler) (system:remove-fd-handler handler)
(setf handler nil)
(decf (car cookie)) (decf (car cookie))
(mach:unix-close descriptor) (mach:unix-close descriptor)
(return)) (return))
((null count) ((null count)
(system:remove-fd-handler handler) (system:remove-fd-handler handler)
(setf handler nil)
(decf (car cookie)) (decf (car cookie))
(error "Could not read input from sub-process: ~A" (error "Could not read input from sub-process: ~A"
(mach:get-unix-error-msg errno))) (mach:get-unix-error-msg errno)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment