aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-04-29 22:34:07 +0000
committerdrh <drh@noemail.net>2010-04-29 22:34:07 +0000
commit7ed91f2344f1cb6837e1fba1b83fba5b6ddce887 (patch)
treed8c391a5c11dcc10cf6e142e404ae8ad5b2d89d1 /src/os_unix.c
parent31cbbbad1ccf37ad2f83daf2b34416e643f75d3e (diff)
downloadsqlite-7ed91f2344f1cb6837e1fba1b83fba5b6ddce887.tar.gz
sqlite-7ed91f2344f1cb6837e1fba1b83fba5b6ddce887.zip
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
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c7
1 files changed, 4 insertions, 3 deletions
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;
}