Tcl Source Code

Artifact [2a166f1116]
Login

Artifact 2a166f111642835c6c20e2ec184a93ff8eb60fd5:

Attachment "diff" to ticket [563122ffff] added by jcw 2002-06-01 05:48:46.
Index: generic/tclIO.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIO.c,v
retrieving revision 1.56
diff -u -r1.56 tclIO.c
--- generic/tclIO.c	24 May 2002 21:19:05 -0000	1.56
+++ generic/tclIO.c	31 May 2002 22:38:53 -0000
@@ -5453,7 +5453,16 @@
 		    offset, mode, &result);
 	} else if (offset < Tcl_LongAsWide(LONG_MIN) ||
 		offset > Tcl_LongAsWide(LONG_MAX)) {
+	 /* logic below adapted from tclIOtil.c */
+#ifdef EFBIG
+	    Tcl_SetErrno(EFBIG);
+#else
+#  ifdef EOVERFLOW
 	    Tcl_SetErrno(EOVERFLOW);
+#  else
+#    error  "What status should be returned for file size out of range?"
+#  endif
+#endif
 	    curPos = Tcl_LongAsWide(-1);
 	} else {
 	    curPos = Tcl_LongAsWide((chanPtr->typePtr->seekProc) (
Index: generic/tclIOGT.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOGT.c,v
retrieving revision 1.7
diff -u -r1.7 tclIOGT.c
--- generic/tclIOGT.c	24 May 2002 21:19:06 -0000	1.7
+++ generic/tclIOGT.c	31 May 2002 22:38:54 -0000
@@ -979,7 +979,16 @@
      * happens when trying to go out of the representable range.
      */
     if (offset<Tcl_LongAsWide(LONG_MIN) || offset>Tcl_LongAsWide(LONG_MAX)) {
+         /* logic below adapted from tclIOtil.c */
+#ifdef EFBIG
+	*errorCodePtr = EFBIG;
+#else
+#  ifdef EOVERFLOW
 	*errorCodePtr = EOVERFLOW;
+#  else
+#    error  "What status should be returned for file size out of range?"
+#  endif
+#endif
 	return Tcl_LongAsWide(-1);
     }
     return Tcl_LongAsWide((*parentSeekProc) (parentData,
Index: unix/tclUnixChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixChan.c,v
retrieving revision 1.35
diff -u -r1.35 tclUnixChan.c
--- unix/tclUnixChan.c	24 May 2002 21:19:08 -0000	1.35
+++ unix/tclUnixChan.c	31 May 2002 22:38:55 -0000
@@ -617,7 +617,16 @@
      * Check for expressability in our return type, and roll-back otherwise.
      */
     if (newLoc > Tcl_LongAsWide(INT_MAX)) {
+         /* logic below adapted from tclIOtil.c */
+#ifdef EFBIG
+	*errorCodePtr = EFBIG;
+#else
+#  ifdef EOVERFLOW
 	*errorCodePtr = EOVERFLOW;
+#  else
+#    error  "What status should be returned for file size out of range?"
+#  endif
+#endif
 	Tcl_PlatformSeek(fsPtr->fd, (Tcl_SeekOffset) oldLoc, SEEK_SET);
 	return -1;
     } else {