From 7ed91f2344f1cb6837e1fba1b83fba5b6ddce887 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 29 Apr 2010 22:34:07 +0000 Subject: Refactor wal.c to use the VFS. This check-in compiles and links and works ok as long as you leave WAL turned off, but WAL does not work. FossilOrigin-Name: 62db5fa3b61be885b2d94e9b9ce3877b2c588350 --- src/os_unix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/os_unix.c') diff --git a/src/os_unix.c b/src/os_unix.c index 248309664..0e525c073 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5049,6 +5049,7 @@ static int unixShmClose(sqlite3_shm *pSharedMem){ unixShm **pp; /* For looping over sibling connections */ int nRef; /* Number of connections to pFile */ + if( pSharedMem==0 ) return SQLITE_OK; p = (struct unixShm*)pSharedMem; pFile = p->pFile; @@ -5092,7 +5093,7 @@ static int unixShmSize( sqlite3_shm *pSharedMem, /* Pointer returned by unixShmOpen() */ int reqSize, /* Requested size. -1 for query only */ int *pNewSize, /* Write new size here */ - char **ppBuf /* Write new buffer origin here */ + void **ppBuf /* Write new buffer origin here */ ){ unixShm *p = (unixShm*)pSharedMem; unixShmFile *pFile = p->pFile; @@ -5165,7 +5166,7 @@ static int unixShmLock( || desiredLock==p->lockState || (desiredLock==SQLITE_SHM_READ && p->lockState==SQLITE_SHM_READ_FULL) ){ - *pGotLock = p->lockState; + if( pGotLock ) *pGotLock = p->lockState; return SQLITE_OK; } @@ -5257,7 +5258,7 @@ static int unixShmLock( } } sqlite3_mutex_leave(pFile->mutex); - *pGotLock = p->lockState; + if( pGotLock ) *pGotLock = p->lockState; return rc; } -- cgit v1.2.3