X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Frun-program.lisp;h=05c63338ec348570f8e056919ef4e0b6ecf88e60;hb=3f3033a6c0ddf0af8dd1b5a17c2a4b82ea59b94f;hp=b854e3109faf78fa1f20c52f79ff4d2f2877bb26;hpb=7e0235c6f230d9e07a710a33479697f174f393fb;p=sbcl.git diff --git a/src/code/run-program.lisp b/src/code/run-program.lisp index b854e31..05c6333 100644 --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -729,6 +729,8 @@ Users Manual for details about the PROCESS structure."#-win32" ;; hard-coded symbols here. (values stdout output-stream) (get-descriptor-for ,@args)))) + (unless ,fd + (return-from run-program)) ,@body)) (with-open-pty (((pty-name pty-stream) (pty cookie)) &body body) @@ -1010,15 +1012,16 @@ Users Manual for details about the PROCESS structure."#-win32" ;; validation there. (with-open-stream (file (apply #'open object :allow-other-keys t keys)) - (multiple-value-bind - (fd errno) - (sb-unix:unix-dup (sb-sys:fd-stream-fd file)) - (cond (fd - (push fd *close-in-parent*) - (values fd nil)) - (t - (error "couldn't duplicate file descriptor: ~A" - (strerror errno))))))) + (when file + (multiple-value-bind + (fd errno) + (sb-unix:unix-dup (sb-sys:fd-stream-fd file)) + (cond (fd + (push fd *close-in-parent*) + (values fd nil)) + (t + (error "couldn't duplicate file descriptor: ~A" + (strerror errno)))))))) ((streamp object) (ecase direction (:input