From 2a1da6179ac93ce047e185c8345ca8c90a140ac2 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 13 May 1996 05:01:11 +0000 Subject: [PATCH] Fix bug: reading output from a subprocess would occasionally signal an error because the subprocess output channel was closed by Scheme when it detected that the subprocess had closed the other end of the pipe. However, the "output-copier" loop continued to operate assuming that the channel was open. --- v7/src/edwin/process.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v7/src/edwin/process.scm b/v7/src/edwin/process.scm index 844dc660a..c769f0517 100644 --- a/v7/src/edwin/process.scm +++ b/v7/src/edwin/process.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: process.scm,v 1.43 1996/05/12 07:13:03 cph Exp $ +;;; $Id: process.scm,v 1.44 1996/05/13 05:01:11 cph Exp $ ;;; ;;; Copyright (c) 1991-96 Massachusetts Institute of Technology ;;; @@ -689,9 +689,11 @@ after the listing is made.)" (loop)))))))))) (channel-nonblocking channel) (let ((status (receiver copy-output))) - (channel-blocking channel) - (copy-output) - (channel-close channel) + (if (channel-open? channel) + (begin + (channel-blocking channel) + (copy-output) + (channel-close channel))) status))) (receiver (lambda () unspecific)))) -- 2.25.1