From ff0bc8f9f776fca7f6288b7e725f9bc0cc5468ac Mon Sep 17 00:00:00 2001 From: mistachkin Date: Wed, 28 May 2014 03:23:55 +0000 Subject: [PATCH] Revise how OSTRACE reports logically boolean results in the Win32 VFS. FossilOrigin-Name: c405f971cf03e29110019ff863cbfb026d97e1e6 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_win.c | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/manifest b/manifest index c071341fc7..faef47fa27 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\san\sincorrect\sassert()\sin\sthe\ssorter. -D 2014-05-27T20:19:06.293 +C Revise\show\sOSTRACE\sreports\slogically\sboolean\sresults\sin\sthe\sWin32\sVFS. +D 2014-05-28T03:23:55.937 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -206,7 +206,7 @@ F src/os.h 60d419395e32a8029fa380a80a3da2e9030f635e F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c ae4b5240af4619d711301d7992396e182585269f -F src/os_win.c 485d06a93965f306c7281fca0937829292367234 +F src/os_win.c 648f842876e25391b7c454c8e49f7db1fd981d65 F src/os_win.h 057344a6720b4c8405d9bd98f58cb37a6ee46c25 F src/pager.c f6bb1fa6cdf2062f2d8aec3e64db302bca519ab8 F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428 @@ -1173,7 +1173,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 20b75460c0661b5dc071177b4a0791aceccda029 -R d313f2f9d0d10f0cab7c1f3623a16b09 -U drh -Z b3d89b92529dc184b6d7c7b851a6fe5b +P b8b66103de8c554cb87df40bf040760ec29f2ae1 +R fb2228bf340b8e64476c0b547456f447 +U mistachkin +Z 33db4268ebdb5368353cf9e380a10aca diff --git a/manifest.uuid b/manifest.uuid index dcd05b62b0..a5c805d0f6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b8b66103de8c554cb87df40bf040760ec29f2ae1 \ No newline at end of file +c405f971cf03e29110019ff863cbfb026d97e1e6 \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index fcac665dff..21f633e486 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -2825,7 +2825,7 @@ static int winGetReadLock(winFile *pFile){ pFile->lastErrno = osGetLastError(); /* No need to log a failure to lock */ } - OSTRACE(("READ-LOCK file=%p, rc=%s\n", pFile->h, sqlite3ErrName(res))); + OSTRACE(("READ-LOCK file=%p, result=%d\n", pFile->h, res)); return res; } @@ -2849,7 +2849,7 @@ static int winUnlockReadLock(winFile *pFile){ winLogError(SQLITE_IOERR_UNLOCK, pFile->lastErrno, "winUnlockReadLock", pFile->zPath); } - OSTRACE(("READ-UNLOCK file=%p, rc=%s\n", pFile->h, sqlite3ErrName(res))); + OSTRACE(("READ-UNLOCK file=%p, result=%d\n", pFile->h, res)); return res; } @@ -2924,8 +2924,8 @@ static int winLock(sqlite3_file *id, int locktype){ ** If you are using this code as a model for alternative VFSes, do not ** copy this retry logic. It is a hack intended for Windows only. */ - OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, rc=%s\n", - pFile->h, cnt, sqlite3ErrName(res))); + OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n", + pFile->h, cnt, res)); if( cnt ) sqlite3_win32_sleep(1); } gotPendingLock = res; @@ -3010,7 +3010,7 @@ static int winLock(sqlite3_file *id, int locktype){ ** non-zero, otherwise zero. */ static int winCheckReservedLock(sqlite3_file *id, int *pResOut){ - int rc; + int res; winFile *pFile = (winFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); @@ -3018,17 +3018,17 @@ static int winCheckReservedLock(sqlite3_file *id, int *pResOut){ assert( id!=0 ); if( pFile->locktype>=RESERVED_LOCK ){ - rc = 1; - OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (local)\n", pFile->h, rc)); + res = 1; + OSTRACE(("TEST-WR-LOCK file=%p, result=%d (local)\n", pFile->h, res)); }else{ - rc = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0); - if( rc ){ + res = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0); + if( res ){ winUnlockFile(&pFile->h, RESERVED_BYTE, 0, 1, 0); } - rc = !rc; - OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (remote)\n", pFile->h, rc)); + res = !res; + OSTRACE(("TEST-WR-LOCK file=%p, result=%d (remote)\n", pFile->h, res)); } - *pResOut = rc; + *pResOut = res; OSTRACE(("TEST-WR-LOCK file=%p, pResOut=%p, *pResOut=%d, rc=SQLITE_OK\n", pFile->h, pResOut, *pResOut)); return SQLITE_OK; -- 2.47.2