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:
20
src/os.c
20
src/os.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user