From 2e8f4ebf1575b0db50c52fd83f712438c0fd841f Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Fri, 14 Jan 2011 01:25:43 +0100 Subject: [PATCH] RUN-PROGRAM: redirect STDERR to a pipe by default --- src/os/create-process-unix.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os/create-process-unix.lisp b/src/os/create-process-unix.lisp index 3a28965..8d3d7eb 100644 --- a/src/os/create-process-unix.lisp +++ b/src/os/create-process-unix.lisp @@ -213,7 +213,7 @@ (make-instance 'process :pid (mem-ref pid 'pid-t) :stdin infd :stdout outfd :stderr errfd))))))) -(defun run-program (program-and-args &key (environment t) (stderr t)) +(defun run-program (program-and-args &key (environment t) (stderr :pipe)) (flet ((slurp (stream) (with-output-to-string (s) (loop :for c := (read-char stream nil nil) @@ -222,11 +222,11 @@ :environment environment :stdin nil :stdout :pipe - :stderr (if stderr :pipe +stdout+)))) + :stderr stderr))) (unwind-protect (values (process-wait process) (slurp (process-stdout process)) - (if stderr + (if (eql :pipe stderr) (slurp (process-stderr process)) (make-string 0))) (close process))))) -- 2.11.4.GIT