From 1615d0bcaf3230b612459a2c7ad6652aa1ea42d3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 12 Sep 2013 09:45:50 -0700 Subject: [PATCH] channel-read/write: apply channel-blocking? to a closed channel NOT. --- src/runtime/io.scm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/runtime/io.scm b/src/runtime/io.scm index df1da9a02..6ae884913 100644 --- a/src/runtime/io.scm +++ b/src/runtime/io.scm @@ -180,9 +180,12 @@ USA. (if (eq? n #t) (begin (handle-subprocess-status-change) - (if (channel-blocking? channel) - (loop) - #f)) + (without-interrupts + (lambda () + (if (and (channel-open? channel) + (channel-blocking? channel)) + (loop) + #f)))) n)))) (define (%channel-read channel buffer start end) @@ -215,9 +218,12 @@ USA. (if (eq? n #t) (begin (handle-subprocess-status-change) - (if (channel-blocking? channel) - (loop) - #f)) + (without-interrupts + (lambda () + (if (and (channel-open? channel) + (channel-blocking? channel)) + (loop) + #f)))) n)))) (define (%channel-write channel buffer start end) -- 2.25.1