From: Chris Hanson Date: Thu, 27 May 2004 16:06:31 +0000 (+0000) Subject: When closing a port, don't try to flush output if the channel is X-Git-Tag: 20090517-FFI~1644 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fc36267f6f2ccb74f9a0fd139553641aa2b2a308;p=mit-scheme.git When closing a port, don't try to flush output if the channel is already closed. --- 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)))