From: Chris Hanson Date: Mon, 13 May 1996 05:01:11 +0000 (+0000) Subject: Fix bug: reading output from a subprocess would occasionally signal an X-Git-Tag: 20090517-FFI~5526 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2a1da6179ac93ce047e185c8345ca8c90a140ac2;p=mit-scheme.git 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. --- 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))))