X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Frun-program.lisp;h=0417401ce26c2249b129b6cdc81a2b3d305c23ee;hb=4255b37e50876702d2563f3418a44a3f5bf8a2e8;hp=1a4b7e7c2116885c768c49cae47d5fdf2b054ef3;hpb=5896b1fd29648a6cc4beef194ab3c3d075983c66;p=sbcl.git diff --git a/src/code/run-program.lisp b/src/code/run-program.lisp index 1a4b7e7..0417401 100644 --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -496,7 +496,7 @@ status slot." ;; Copy string. (sb-kernel:copy-ub8-to-system-area octets 0 string-sap 0 size) ;; NULL-terminate it - (setf (sap-ref-32 string-sap size) 0) + (sb-kernel:system-area-ub8-fill 0 string-sap size 4) ;; Put the pointer in the vector. (setf (sap-ref-sap vec-sap vec-index-offset) string-sap) ;; Advance string-sap for the next string. @@ -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)) - ;; FIXME: nothing seems to set this. #-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 @@ -896,7 +898,9 @@ Users Manual for details about the PROCESS structure."#-win32" (strerror errno))) (t (incf read-end count) - (funcall copy-fun)))))))))) + (funcall copy-fun)))))))) + #-win32 + (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