projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix (run-program) to cleanup fd handlers
[sbcl.git]
/
src
/
code
/
run-program.lisp
diff --git
a/src/code/run-program.lisp
b/src/code/run-program.lisp
index
1a4b7e7
..
512a7a9
100644
(file)
--- a/
src/code/run-program.lisp
+++ b/
src/code/run-program.lisp
@@
-799,13
+799,15
@@
Users Manual for details about the PROCESS structure."#-win32"
(unless proc
(dolist (fd *close-on-error*)
(sb-unix:unix-close fd))
(unless proc
(dolist (fd *close-on-error*)
(sb-unix:unix-close fd))
- ;; FIXME: nothing seems to set this.
#-win32
(dolist (handler *handlers-installed*)
#-win32
(dolist (handler *handlers-installed*)
- (sb-sys:remove-fd-handler handler))))
- #-win32
- (when (and wait proc)
- (process-wait proc))
+ (sb-sys:remove-fd-handler handler)))
+ #-win32
+ (when (and wait proc)
+ (unwind-protect
+ (process-wait proc)
+ (dolist (handler *handlers-installed*)
+ (sb-sys:remove-fd-handler handler)))))
proc)))
;;; Install a handler for any input that shows up on the file
proc)))
;;; Install a handler for any input that shows up on the file
@@
-896,7
+898,8
@@
Users Manual for details about the PROCESS structure."#-win32"
(strerror errno)))
(t
(incf read-end count)
(strerror errno)))
(t
(incf read-end count)
- (funcall copy-fun))))))))))
+ (funcall copy-fun))))))))
+ (push handler *handlers-installed*)))
;;; FIXME: something very like this is done in SB-POSIX to treat
;;; streams as file descriptor designators; maybe we can combine these
;;; FIXME: something very like this is done in SB-POSIX to treat
;;; streams as file descriptor designators; maybe we can combine these