apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r388242 - /apr/apr/branches/1.2.x/file_io/win32/seek.c
Date Thu, 23 Mar 2006 19:37:22 GMT
Author: wrowe
Date: Thu Mar 23 11:37:20 2006
New Revision: 388242

URL: http://svn.apache.org/viewcvs?rev=388242&view=rev
Log:

  The original value before seek() certainly could be at the upper bounds
  of 2^32-1.  Protect against this by trusting the error result.

Backports: 388241

Modified:
    apr/apr/branches/1.2.x/file_io/win32/seek.c

Modified: apr/apr/branches/1.2.x/file_io/win32/seek.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/seek.c?rev=388242&r1=388241&r2=388242&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/file_io/win32/seek.c (original)
+++ apr/apr/branches/1.2.x/file_io/win32/seek.c Thu Mar 23 11:37:20 2006
@@ -48,9 +48,16 @@
         DWORD offhi = (DWORD)(pos >> 32);
         rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN);
 
-        if (rc == 0xFFFFFFFF)
+        if (rc == INVALID_SET_FILE_POINTER)
+            /* A legal value, perhaps?  MSDN implies prior SetLastError isn't 
+             * needed, googling for SetLastError SetFilePointer seems
+             * to confirm this.
+             */
             rv = apr_get_os_error();
-        else {
+        else
+            rv = APR_SUCCESS;
+
+        if (rv == APR_SUCCESS) {
             rv = APR_SUCCESS;
             thefile->eof_hit = 0;
             thefile->bufpos = thefile->dataRead = 0;



Mime
View raw message