SQLite

Check-in [646244008f]
Login

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

Overview
Comment:Fix a bug (ticket #541) introduced by the previous check-in ((1149)). (CVS 1150)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 646244008fb8a6eef4169291d75da59fa1ab26f9
User & Date: drh 2003-12-31 16:00:19.000
Context
2003-12-31
17:25
Fix for ticket #542. (CVS 1151) (check-in: 458cfa5ba8 user: drh tags: trunk)
16:00
Fix a bug (ticket #541) introduced by the previous check-in ((1149)). (CVS 1150) (check-in: 646244008f user: drh tags: trunk)
13:21
Reduce the randomness in the sqliteRandomSeed() routine in order to silence bogus errors from valgrind. Tickets #535 and #536. (CVS 1149) (check-in: cfe0acf9ec user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os.c.
1451
1452
1453
1454
1455
1456
1457

1458
1459
1460
1461

1462
1463
1464
1465
1466

1467
1468
1469
1470

1471
1472
1473
1474
1475
1476
1477
  **
  ** When testing, initializing zBuf[] to zero is all we do.  That means
  ** that we always use the same random number sequence.* This makes the
  ** tests repeatable.
  */
  memset(zBuf, 0, 256);
#if OS_UNIX && !defined(SQLITE_TEST)

  int pid;
  time((time_t*)zBuf);
  pid = getpid();
  memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));

#endif
#if OS_WIN && !defined(SQLITE_TEST)
  GetSystemTime((LPSYSTEMTIME)zBuf);
#endif
#if OS_MAC

  int pid;
  Microseconds((UnsignedWide*)zBuf);
  pid = getpid();
  memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid));

#endif
  return SQLITE_OK;
}

/*
** Sleep for a little while.  Return the amount of time slept.
*/







>
|
|
|
|
>





>
|
|
|
|
>







1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
  **
  ** When testing, initializing zBuf[] to zero is all we do.  That means
  ** that we always use the same random number sequence.* This makes the
  ** tests repeatable.
  */
  memset(zBuf, 0, 256);
#if OS_UNIX && !defined(SQLITE_TEST)
  {
    int pid;
    time((time_t*)zBuf);
    pid = getpid();
    memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
  }
#endif
#if OS_WIN && !defined(SQLITE_TEST)
  GetSystemTime((LPSYSTEMTIME)zBuf);
#endif
#if OS_MAC
  {
    int pid;
    Microseconds((UnsignedWide*)zBuf);
    pid = getpid();
    memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid));
  }
#endif
  return SQLITE_OK;
}

/*
** Sleep for a little while.  Return the amount of time slept.
*/