aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 39a31cb18..75f923601 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3710,7 +3710,9 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
return SQLITE_OK;
}
case SQLITE_FCNTL_MMAP_LIMIT: {
- pFile->mmapLimit = *(i64*)pArg;
+ i64 newLimit = *(i64*)pArg;
+ *(i64*)pArg = pFile->mmapLimit;
+ if( newLimit>=0 ) pFile->mmapLimit = newLimit;
return SQLITE_OK;
}
#ifdef SQLITE_DEBUG