1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix a bug (ticket #541) introduced by the previous check-in ((1149)). (CVS 1150)

FossilOrigin-Name: 646244008fb8a6eef4169291d75da59fa1ab26f9
This commit is contained in:
drh
2003-12-31 16:00:19 +00:00
parent dff7ec2cbd
commit 07fa2a60ea
3 changed files with 19 additions and 15 deletions

View File

@@ -1455,19 +1455,23 @@ int sqliteOsRandomSeed(char *zBuf){
*/
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));
{
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));
{
int pid;
Microseconds((UnsignedWide*)zBuf);
pid = getpid();
memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid));
}
#endif
return SQLITE_OK;
}