/ Check-in [daed2bab]
Login

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

Overview
Comment:Suppress compiler warnings. Fix a bug in IO error detection on windows. (CVS 3564)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:daed2bab00ea3952d2d4e5182ca07653b9d80ac2
User & Date: drh 2007-01-05 14:38:55
Context
2007-01-05
14:41
Remove redundant variable. (CVS 3565) check-in: 2a7f5aaf user: drh tags: trunk
14:38
Suppress compiler warnings. Fix a bug in IO error detection on windows. (CVS 3564) check-in: daed2bab user: drh tags: trunk
02:00
In the btree.c, when releasing the page1 lock, first make sure the pager has not reset and released the lock already. This fixes a bug introduced by (3549). (CVS 3563) check-in: 36a2db96 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

   999    999   */
  1000   1000   static int winRead(OsFile *id, void *pBuf, int amt){
  1001   1001     DWORD got;
  1002   1002     assert( id!=0 );
  1003   1003     SimulateIOError(return SQLITE_IOERR);
  1004   1004     TRACE3("READ %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
  1005   1005     if( !ReadFile(((winFile*)id)->h, pBuf, amt, &got, 0) ){
  1006         -    got = -1;
         1006  +    return SQLITE_IOERR_READ;
  1007   1007     }
  1008   1008     if( got==(DWORD)amt ){
  1009   1009       return SQLITE_OK;
  1010         -  }else if( got<0 ){
  1011         -    return SQLITE_IOERR_READ;
  1012   1010     }else{
  1013   1011       memset(&((char*)pBuf)[got], 0, amt-got);
  1014   1012       return SQLITE_IOERR_SHORT_READ;
  1015   1013     }
  1016   1014   }
  1017   1015   
  1018   1016   /*

Changes to src/random.c.

    11     11   *************************************************************************
    12     12   ** This file contains code to implement a pseudo-random number
    13     13   ** generator (PRNG) for SQLite.
    14     14   **
    15     15   ** Random numbers are used by some of the database backends in order
    16     16   ** to generate random integer keys for tables or random filenames.
    17     17   **
    18         -** $Id: random.c,v 1.15 2006/01/06 14:32:20 drh Exp $
           18  +** $Id: random.c,v 1.16 2007/01/05 14:38:56 drh Exp $
    19     19   */
    20     20   #include "sqliteInt.h"
    21     21   #include "os.h"
    22     22   
    23     23   
    24     24   /*
    25     25   ** Get a single 8-bit random value from the RC4 PRNG.  The Mutex
................................................................................
    33     33   ** to know.  To minimize the risk of problems due to bad lrand48()
    34     34   ** implementations, SQLite uses this random number generator based
    35     35   ** on RC4, which we know works very well.
    36     36   **
    37     37   ** (Later):  Actually, OP_NewRowid does not depend on a good source of
    38     38   ** randomness any more.  But we will leave this code in all the same.
    39     39   */
    40         -static int randomByte(){
           40  +static int randomByte(void){
    41     41     unsigned char t;
    42     42   
    43     43     /* All threads share a single random number generator.
    44     44     ** This structure is the current state of the generator.
    45     45     */
    46     46     static struct {
    47     47       unsigned char isInit;          /* True if initialized */