1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

make os2Randomness() act the same as other platforms with SQLITE_TEST (all zeroed buffer) (CVS 5961)

FossilOrigin-Name: 5d189df39a3a5e99372826f87f9f20bbd92f1565
This commit is contained in:
pweilbacher
2008-11-26 19:56:48 +00:00
parent a9bce108be
commit efdabe9e64
3 changed files with 15 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
C Fix\sthe\stest\scondition\sfor\sthe\stest\scases\sadded\sto\sprevent\sregressions\sof\nticket\s#3508.\s(CVS\s5957) C make\sos2Randomness()\sact\sthe\ssame\sas\sother\splatforms\swith\sSQLITE_TEST\s(all\szeroed\sbuffer)\s(CVS\s5961)
D 2008-11-26T13:44:31 D 2008-11-26T19:56:48
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 0aa7bbe3be6acc4045706e3bb3fd0b8f38f4a3b5 F Makefile.in 0aa7bbe3be6acc4045706e3bb3fd0b8f38f4a3b5
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -136,7 +136,7 @@ F src/mutex_w32.c 017b522f63ef09b834fefc9daa876c9ec167e7b5
F src/os.c 0b411644b87ad689d7250bbfd1834d99b81a3df4 F src/os.c 0b411644b87ad689d7250bbfd1834d99b81a3df4
F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892 F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
F src/os_os2.c cd44723f5a7db824ff24823cddd4269310dc0d29 F src/os_os2.c 527d5fc81f4bb271dc410ecea82a43c14e57a4c3
F src/os_unix.c add9937ac646b0f5f8dd603053ceb9264d675a60 F src/os_unix.c add9937ac646b0f5f8dd603053ceb9264d675a60
F src/os_win.c 3dff41670fb9798a869c636626bb7d6d8b6a45bb F src/os_win.c 3dff41670fb9798a869c636626bb7d6d8b6a45bb
F src/pager.c 2e9182e181bbd3d758436d9ccce2a3910400dd30 F src/pager.c 2e9182e181bbd3d758436d9ccce2a3910400dd30
@@ -662,7 +662,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 8271229c66c72c344ad7afb901b88d9cdaaa6f43 P 4e94aa3bedc6dba003a2a4ecbba9c11c465eab4f
R dfb38e895af1414d75f258479ab3847a R 708297e3fd6f935231eadef6a57f7f9e
U drh U pweilbacher
Z 126ab02860dfb1a26b012a237bc58a63 Z c8df22875f69e8165126ebc6cca03ad6

View File

@@ -1 +1 @@
4e94aa3bedc6dba003a2a4ecbba9c11c465eab4f 5d189df39a3a5e99372826f87f9f20bbd92f1565

View File

@@ -12,7 +12,7 @@
** **
** This file contains code that is specific to OS/2. ** This file contains code that is specific to OS/2.
** **
** $Id: os_os2.c,v 1.60 2008/11/22 19:50:54 pweilbacher Exp $ ** $Id: os_os2.c,v 1.61 2008/11/26 19:56:48 pweilbacher Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -966,8 +966,12 @@ static void os2DlClose(sqlite3_vfs *pVfs, void *pHandle){
** Write up to nBuf bytes of randomness into zBuf. ** Write up to nBuf bytes of randomness into zBuf.
*/ */
static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){ static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){
int sizeofULong = sizeof(ULONG);
int n = 0; int n = 0;
#if defined(SQLITE_TEST)
n = nBuf;
memset(zBuf, 0, nBuf);
#else
int sizeofULong = sizeof(ULONG);
if( (int)sizeof(DATETIME) <= nBuf - n ){ if( (int)sizeof(DATETIME) <= nBuf - n ){
DATETIME x; DATETIME x;
DosGetDateTime(&x); DosGetDateTime(&x);
@@ -1015,6 +1019,7 @@ static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){
n += sizeofULong; n += sizeofULong;
} }
} }
#endif
return n; return n;
} }