Skip to content

Commit 1fda83f

Browse files
committed
Omit extra warn-level log on lock failure
SQLCipher already logs at INFO level when a mlock or VirtualLock fails. Since we are already doing everything possible to avoid mlock quotas, and there is nothing practical that can be done to avoid them, this removes the redundant WARN level log.
1 parent eb22644 commit 1fda83f

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/sqlcipher.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,6 @@ static void sqlcipher_mlock(void *ptr, sqlite_uint64 sz) {
735735
sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: calling mlock(%p,%lu); _SC_PAGESIZE=%lu", ptr - offset, sz + offset, pagesize);
736736
rc = mlock(ptr - offset, sz + offset);
737737
if(rc!=0) {
738-
sqlcipher_log(SQLCIPHER_LOG_WARN, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: mlock() returned %d errno=%d", rc, errno);
739738
sqlcipher_log(SQLCIPHER_LOG_INFO, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: mlock(%p,%lu) returned %d errno=%d", ptr - offset, sz + offset, rc, errno);
740739
}
741740
#elif defined(_WIN32)
@@ -744,7 +743,6 @@ static void sqlcipher_mlock(void *ptr, sqlite_uint64 sz) {
744743
sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: calling VirtualLock(%p,%d)", ptr, sz);
745744
rc = VirtualLock(ptr, sz);
746745
if(rc==0) {
747-
sqlcipher_log(SQLCIPHER_LOG_WARN, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: VirtualLock() returned %d LastError=%d", rc, GetLastError());
748746
sqlcipher_log(SQLCIPHER_LOG_INFO, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: VirtualLock(%p,%d) returned %d LastError=%d", ptr, sz, rc, GetLastError());
749747
}
750748
#endif

0 commit comments

Comments
 (0)