aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2013-04-08 15:30:41 +0000
committerdan <dan@noemail.net>2013-04-08 15:30:41 +0000
commitbcb8a868cec66d9edd20e99f7bdb5d2959e2a60d (patch)
tree2d1ecb28336747bc7f438f457fc7fe5e06ecfc8c /src/os_unix.c
parent554052c600f180ba1e23cc44b0598e8f19860de9 (diff)
downloadsqlite-bcb8a868cec66d9edd20e99f7bdb5d2959e2a60d.tar.gz
sqlite-bcb8a868cec66d9edd20e99f7bdb5d2959e2a60d.zip
Handle the case in os_unix.c where SQLITE_FCNTL_MMAP_LIMIT requests that the mmap limit be set to a value smaller than the current mapping.
FossilOrigin-Name: 360473493ec1a7094a2b1c5436f3b70914a6dfdd
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 75f923601..1d4c8ad34 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3712,7 +3712,10 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
case SQLITE_FCNTL_MMAP_LIMIT: {
i64 newLimit = *(i64*)pArg;
*(i64*)pArg = pFile->mmapLimit;
- if( newLimit>=0 ) pFile->mmapLimit = newLimit;
+ if( newLimit>=0 ){
+ pFile->mmapLimit = newLimit;
+ if( newLimit<pFile->mmapSize ) pFile->mmapSize = newLimit;
+ }
return SQLITE_OK;
}
#ifdef SQLITE_DEBUG