svn: r17988
This commit is contained in:
Eli Barzilay 2010-02-05 03:22:26 +00:00
parent 2cc4429c62
commit 0725ba7608

View File

@ -826,13 +826,12 @@
;; set up the IO context ;; set up the IO context
[current-input-port [current-input-port
(let ([inp (sandbox-input)]) (let ([inp (sandbox-input)])
(cond (cond [(not inp) null-input]
[(not inp) null-input] [(input->port inp) => values]
[(input->port inp) => values] [(and (procedure? inp) (procedure-arity-includes? inp 0)) (inp)]
[(and (procedure? inp) (procedure-arity-includes? inp 0)) (inp)] [(eq? 'pipe inp)
[(eq? 'pipe inp) (let-values ([(i o) (make-pipe)]) (set! input o) i)]
(let-values ([(i o) (make-pipe)]) (set! input o) i)] [else (error 'make-evaluator "bad sandbox-input: ~e" inp)]))]
[else (error 'make-evaluator "bad sandbox-input: ~e" inp)]))]
[current-output-port (make-output 'output (sandbox-output) [current-output-port (make-output 'output (sandbox-output)
(lambda (o) (set! output o)))] (lambda (o) (set! output o)))]
[current-error-port (make-output 'error-output (sandbox-error-output) [current-error-port (make-output 'error-output (sandbox-error-output)