From dec511f3574c620e2592c7faabb11e5b4e1c1ed4 Mon Sep 17 00:00:00 2001 From: davygrvy Date: Thu, 14 Apr 2005 02:41:15 +0000 Subject: * generic/tclIO.c (Tcl_SetChannelBufferSize): Lowest size limit * tests/io.test: changed from ten bytes to one byte. Need for this change was proven by Ross Cartlidge where [read stdin 1] was grabbing 10 bytes followed by starting a child process that was intended to continue reading from stdin. Even with -buffersize set to one, nine chars were getting lost by buffer size over reading for the native read(). --- generic/tclIO.c | 8 ++++---- tests/io.test | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index ddc0607..02b4fe8 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.83 2005/04/08 17:10:17 dgp Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.84 2005/04/14 02:41:15 davygrvy Exp $ */ #include "tclInt.h" @@ -6045,7 +6045,7 @@ Tcl_ChannelBuffered(chan) * Tcl_SetChannelBufferSize -- * * Sets the size of buffers to allocate to store input or output - * in the channel. The size must be between 10 bytes and 1 MByte. + * in the channel. The size must be between 1 byte and 1 MByte. * * Results: * None. @@ -6065,11 +6065,11 @@ Tcl_SetChannelBufferSize(chan, sz) ChannelState *statePtr; /* State of real channel structure. */ /* - * If the buffer size is smaller than 10 bytes or larger than one MByte, + * If the buffer size is smaller than 1 byte or larger than one MByte, * do not accept the requested size and leave the current buffer size. */ - if (sz < 10) { + if (sz < 1) { return; } if (sz > (1024 * 1024)) { diff --git a/tests/io.test b/tests/io.test index 8eec145..cb831f8 100644 --- a/tests/io.test +++ b/tests/io.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: io.test,v 1.66 2005/01/27 00:23:29 andreas_kupries Exp $ +# RCS: @(#) $Id: io.test,v 1.67 2005/04/14 02:41:34 davygrvy Exp $ if {[catch {package require tcltest 2}]} { puts stderr "Skipping tests in [info script]. tcltest 2 required." @@ -4792,7 +4792,7 @@ test io-38.2 {Tcl_SetChannelBufferSize, Tcl_GetChannelBufferSize} { lappend l [fconfigure $f -buffersize] close $f set l -} {4096 10000 10000 10000 10000 100000 100000} +} {4096 10000 1 1 1 100000 100000} test io-38.3 {Tcl_SetChannelBufferSize, changing buffersize between reads} { # This test crashes the interp if Bug #427196 is not fixed -- cgit v0.12