diff options
author | 2015-04-04 23:25:54 +0000 | |
---|---|---|
committer | 2015-04-04 23:25:54 +0000 | |
commit | 836e875b8844d04142334118ee8d263359fcc474 (patch) | |
tree | 440e2a6c272dd0e78f15b8fde815d8206f0c7041 /lib/libsqlite3/src/random.c | |
parent | Update sqlite3 to 3.8.8.3. Changes available here: (diff) | |
download | wireguard-openbsd-836e875b8844d04142334118ee8d263359fcc474.tar.xz wireguard-openbsd-836e875b8844d04142334118ee8d263359fcc474.zip |
Merge conflicts
Diffstat (limited to 'lib/libsqlite3/src/random.c')
-rw-r--r-- | lib/libsqlite3/src/random.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/libsqlite3/src/random.c b/lib/libsqlite3/src/random.c index 145731051bb..a0db527f93c 100644 --- a/lib/libsqlite3/src/random.c +++ b/lib/libsqlite3/src/random.c @@ -53,11 +53,19 @@ void sqlite3_randomness(int N, void *pBuf){ #endif #if SQLITE_THREADSAFE - sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG); - sqlite3_mutex_enter(mutex); + sqlite3_mutex *mutex; +#endif + +#ifndef SQLITE_OMIT_AUTOINIT + if( sqlite3_initialize() ) return; #endif - if( N<=0 ){ +#if SQLITE_THREADSAFE + mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG); +#endif + + sqlite3_mutex_enter(mutex); + if( N<=0 || pBuf==0 ){ wsdPrng.isInit = 0; sqlite3_mutex_leave(mutex); return; |