/ Check-in [dc7f84df]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix typos in logging code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winPreCache
Files: files | file ages | folders
SHA1:dc7f84dfcc8415fad4af041fd30c20b3fd91be45
User & Date: mistachkin 2014-05-08 22:15:13
Context
2014-05-09
00:36
Fix several harmless compiler warnings. Closed-Leaf check-in: 360c0fd1 user: mistachkin tags: winPreCache
2014-05-08
22:15
Fix typos in logging code. check-in: dc7f84df user: mistachkin tags: winPreCache
22:08
Fix a memory leak of the temporary read buffer. check-in: 37e60d21 user: mistachkin tags: winPreCache
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
....
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
  dwRet = osSetFilePointer(dupHandle, 0, 0, FILE_BEGIN);
  if( (dwRet==INVALID_SET_FILE_POINTER
      && ((lastErrno = osGetLastError())!=NO_ERROR)) ){
    pFile->lastErrno = lastErrno;
    osCloseHandle(dupHandle);
    OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SEEK\n", dupHandle));
    return winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
                       "winPreCacheThread2", pFile->zPath);
  }
  dwAmt = 4194304; /* TODO: Tuning. */
  if( dwSize<dwAmt ){
    dwAmt = dwSize;
  }
  pBuf = sqlite3MallocZero( dwAmt );
  if( pBuf==0 ){
................................................................................
  while( 1 ){
    if( !osReadFile(dupHandle, pBuf, dwAmt, &nRead, 0) ){
      pFile->lastErrno = osGetLastError();
      sqlite3_free(pBuf);
      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
                         "winPreCacheThread3", pFile->zPath);
    }
    if( nRead<dwAmt ){
      sqlite3_free(pBuf);
      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SHORT_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_SHORT_READ, pFile->lastErrno,
                         "winPreCacheThread4", pFile->zPath);
    }
    dwSize -= dwAmt;
    if( dwSize==0 ){
      break;
    }
  }
  sqlite3_free(pBuf);







|







 







|






|







3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
....
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
  dwRet = osSetFilePointer(dupHandle, 0, 0, FILE_BEGIN);
  if( (dwRet==INVALID_SET_FILE_POINTER
      && ((lastErrno = osGetLastError())!=NO_ERROR)) ){
    pFile->lastErrno = lastErrno;
    osCloseHandle(dupHandle);
    OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SEEK\n", dupHandle));
    return winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
                       "winPreCacheThread3", pFile->zPath);
  }
  dwAmt = 4194304; /* TODO: Tuning. */
  if( dwSize<dwAmt ){
    dwAmt = dwSize;
  }
  pBuf = sqlite3MallocZero( dwAmt );
  if( pBuf==0 ){
................................................................................
  while( 1 ){
    if( !osReadFile(dupHandle, pBuf, dwAmt, &nRead, 0) ){
      pFile->lastErrno = osGetLastError();
      sqlite3_free(pBuf);
      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
                         "winPreCacheThread4", pFile->zPath);
    }
    if( nRead<dwAmt ){
      sqlite3_free(pBuf);
      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SHORT_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_SHORT_READ, pFile->lastErrno,
                         "winPreCacheThread5", pFile->zPath);
    }
    dwSize -= dwAmt;
    if( dwSize==0 ){
      break;
    }
  }
  sqlite3_free(pBuf);