commit c0f27706524c1a81ba7f2aa9506a94f8c7f80b1f parent a3e43a0cb255ac3e759564ef8fe905d2c53472c6 Author: Tomas Hlavaty <tom@logand.com> Date: Sat, 11 Apr 2015 21:12:19 +0200 more mkcl porting Diffstat:
M | os.lisp | | | 21 | +++++++++++++++++++++ |
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/os.lisp b/os.lisp @@ -91,6 +91,27 @@ (:streams (values io io)) (:wait (ext:external-process-wait p)) (:close (when io (close io)))))) ;; TODO is this the right thing to close process? + #+mkcl + (multiple-value-bind (io p x) + (mkcl:run-program cmd + args + :input input + :output output + :error nil + :wait (not (or input output)) ;; TODO why wait=nil + wait call doesnt work? + :search t) + (let ((status (mkcl:process-status p))) + (if input + (assert (eq :running status)) + (assert (member status '(:running :exited))))) + (lambda (msg) + (ecase msg + (:fail (fail (mkcl:process-exit-code p))) + (:status-and-code (values (mkcl:process-status p) + (mkcl:process-exit-code p))) + (:streams (values (when input io) (when output io))) + (:wait (mkcl:join-process p)) + (:close (when io (close io)))))) #+sbcl (let ((p (sb-ext:run-program cmd args