From 7a17535a4cac473a9dfab8b3816e06908e9a918f Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 10 Sep 2004 20:06:40 +0000 Subject: Fix [Bug 1025359] to make sure wide seeks don't lose errors --- ChangeLog | 5 +++++ generic/tclIO.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9a58f9..63ec03d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-10 Donal K. Fellows + + * generic/tclIO.c (Tcl_Seek): Make sure wide seeks do not fail to + set ::errorCode on error. [Bug 1025359] + 2004-09-10 Andreas Kupries * generic/tcl.h: Micro formatting fixes. diff --git a/generic/tclIO.c b/generic/tclIO.c index 154bec0..054cc89 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.61.2.7 2004/07/15 20:46:18 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.61.2.8 2004/09/10 20:06:41 dkf Exp $ */ #include "tclInt.h" @@ -5544,15 +5544,15 @@ Tcl_Seek(chan, offset, mode) offset, mode, &result); } else if (offset < Tcl_LongAsWide(LONG_MIN) || offset > Tcl_LongAsWide(LONG_MAX)) { - Tcl_SetErrno(EOVERFLOW); + result = EOVERFLOW; curPos = Tcl_LongAsWide(-1); } else { curPos = Tcl_LongAsWide((chanPtr->typePtr->seekProc) ( chanPtr->instanceData, Tcl_WideAsLong(offset), mode, &result)); - if (curPos == Tcl_LongAsWide(-1)) { - Tcl_SetErrno(result); - } + } + if (curPos == Tcl_LongAsWide(-1)) { + Tcl_SetErrno(result); } } -- cgit v0.12