From fc36267f6f2ccb74f9a0fd139553641aa2b2a308 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 27 May 2004 16:06:31 +0000 Subject: [PATCH] When closing a port, don't try to flush output if the channel is already closed. --- v7/src/runtime/genio.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/v7/src/runtime/genio.scm b/v7/src/runtime/genio.scm index bb88bbf8b..c53889b6d 100644 --- a/v7/src/runtime/genio.scm +++ b/v7/src/runtime/genio.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: genio.scm,v 1.31 2004/05/26 15:19:53 cph Exp $ +$Id: genio.scm,v 1.32 2004/05/27 16:06:31 cph Exp $ Copyright 1991,1993,1995,1996,1999,2002 Massachusetts Institute of Technology Copyright 2003,2004 Massachusetts Institute of Technology @@ -718,8 +718,10 @@ USA. (channel-open? (output-buffer-channel ob))) (define (close-output-buffer ob) - (force-drain-output-buffer ob) - (channel-close (output-buffer-channel ob))) + (if (output-buffer-open? ob) + (begin + (force-drain-output-buffer ob) + (channel-close (output-buffer-channel ob))))) (define-integrable (output-buffer-port ob) (channel-port (output-buffer-channel ob))) -- 2.25.1