mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-24 13:31:58 -08:00
run-program: move t->stream coercion at the beginning
this is important for piping.
This commit is contained in:
parent
e329d5bb49
commit
a42d199b6a
1 changed files with 8 additions and 6 deletions
|
|
@ -109,9 +109,11 @@
|
|||
(external-format :default)
|
||||
#+windows (escape-arguments t))
|
||||
|
||||
(labels ((process-stream (which default &rest args)
|
||||
(when (eql which t)
|
||||
(setf which default))
|
||||
(when (eql input t) (setf input *standard-input*))
|
||||
(when (eql output t) (setf input *standard-output*))
|
||||
(when (eql error t) (setf input *error-output*))
|
||||
|
||||
(labels ((process-stream (which &rest args)
|
||||
(cond ((null which)
|
||||
(null-stream (getf args :direction)))
|
||||
((or (stringp which)
|
||||
|
|
@ -147,15 +149,15 @@
|
|||
(let ((progname (si:copy-to-simple-base-string command))
|
||||
(args (prepare-args (cons command argv)))
|
||||
(process (make-external-process))
|
||||
(process-input (process-stream input *standard-input*
|
||||
(process-input (process-stream input
|
||||
:direction :input
|
||||
:if-does-not-exist if-input-does-not-exist))
|
||||
(process-output (process-stream output *standard-output*
|
||||
(process-output (process-stream output
|
||||
:direction :output
|
||||
:if-exists if-output-exists))
|
||||
(process-error (if (eql error :output)
|
||||
:output
|
||||
(process-stream error *error-output*
|
||||
(process-stream error
|
||||
:direction :output
|
||||
:if-exists if-error-exists)))
|
||||
pid parent-write parent-read parent-error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue