/ Check-in [373b56f0]
Login

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

Overview
Comment:Fix an alignment problem in the sqlite3OsRandomSeed(). Ticket #1584. (CVS 2872)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:373b56f0048fd6a1946a97acfcca40fd12f7d572
User & Date: drh 2006-01-06 14:46:47
Context
2006-01-06
15:03
Fix a crash caused by adding a trigger to a shared-schema and then deleting it using a different connection. (CVS 2873) check-in: 19f93e13 user: danielk1977 tags: trunk
14:46
Fix an alignment problem in the sqlite3OsRandomSeed(). Ticket #1584. (CVS 2872) check-in: 373b56f0 user: drh tags: trunk
14:41
Remove vestigial file: crashtest1.c (CVS 2871) check-in: 6676c703 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

1572
1573
1574
1575
1576
1577
1578
1579


1580
1581
1582
1583
1584
1585
1586
  */
  memset(zBuf, 0, 256);
#if !defined(SQLITE_TEST)
  {
    int pid, fd;
    fd = open("/dev/urandom", O_RDONLY);
    if( fd<0 ){
      time((time_t*)zBuf);


      pid = getpid();
      memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
    }else{
      read(fd, zBuf, 256);
      close(fd);
    }
  }







|
>
>







1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
  */
  memset(zBuf, 0, 256);
#if !defined(SQLITE_TEST)
  {
    int pid, fd;
    fd = open("/dev/urandom", O_RDONLY);
    if( fd<0 ){
      time_t t;
      time(&t);
      memcpy(zBuf, &t, sizeof(t));
      pid = getpid();
      memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
    }else{
      read(fd, zBuf, 256);
      close(fd);
    }
  }