mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-22 04:21:16 -08:00
run-program: gray-stream: small refactor
This commit is contained in:
parent
3da53b617e
commit
d445963784
1 changed files with 20 additions and 22 deletions
|
|
@ -158,29 +158,27 @@
|
|||
:if-exists if-error-exists)))
|
||||
pid parent-write parent-read parent-error)
|
||||
|
||||
(case #1=process-input
|
||||
(null
|
||||
(setf #1# (null-stream :output)))
|
||||
(:gray-stream
|
||||
(setf #1# :stream)
|
||||
(warn "EXT:RUN-PROGRAM: Ignorning gray stream as :INPUT argument.")))
|
||||
|
||||
(case #2=process-output
|
||||
(null
|
||||
(setf #2# (null-stream :input)))
|
||||
(:gray-stream
|
||||
(setf #2# :stream)
|
||||
(warn "EXT:RUN-PROGRAM: Ignorning gray stream as :OUTPUT argument.")))
|
||||
|
||||
(case #3=process-error
|
||||
(null
|
||||
(setf #3# (null-stream :input)))
|
||||
(:gray-stream
|
||||
(setf #3# :stream)
|
||||
(warn "EXT:RUN-PROGRAM: Ignorning gray stream as :ERROR argument.")))
|
||||
|
||||
(multiple-value-setq (pid parent-write parent-read parent-error)
|
||||
(si:spawn-subprocess progname args environ process-input process-output process-error))
|
||||
(si:spawn-subprocess progname args environ
|
||||
(case process-input
|
||||
(null (null-stream :output))
|
||||
(:gray-stream :stream)
|
||||
(otherwise process-input))
|
||||
(case process-output
|
||||
(null (null-stream :input))
|
||||
(:gray-stream :stream)
|
||||
(otherwise process-output))
|
||||
(case process-error
|
||||
(null (null-stream :input))
|
||||
(:gray-stream :stream)
|
||||
(otherwise process-error))))
|
||||
|
||||
(when (eql process-input :gray-stream)
|
||||
(warn "EXT:RUN-PROGRAM: Ignorning gray stream as :INPUT argument."))
|
||||
(when (eql process-output :gray-stream)
|
||||
(warn "EXT:RUN-PROGRAM: Ignorning gray stream as :OUTPUT argument."))
|
||||
(when (eql process-error :gray-stream)
|
||||
(warn "EXT:RUN-PROGRAM: Ignorning gray stream as :ERROR argument."))
|
||||
|
||||
(let ((stream-write
|
||||
(when (plusp parent-write)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue