1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix the computation of the offset on the mmap() for the Nth shared memory

region.  Because of the way shared memory is accessed, the old computation,
though wrong, still happened to always get the right answer.  Nevertheless,
it is good to do the computation correctly.

FossilOrigin-Name: 36397f62f2e3a62b4d5730b29c197449c6850cac
This commit is contained in:
drh
2010-09-02 14:00:19 +00:00
parent 4336cc45c5
commit 37e8b5b2cc
3 changed files with 19 additions and 9 deletions

View File

@@ -3559,7 +3559,7 @@ static int unixShmMap(
pShmNode->apRegion = apNew;
while(pShmNode->nRegion<=iRegion){
void *pMem = mmap(0, szRegion, PROT_READ|PROT_WRITE,
MAP_SHARED, pShmNode->h, iRegion*szRegion
MAP_SHARED, pShmNode->h, pShmNode->nRegion*szRegion
);
if( pMem==MAP_FAILED ){
rc = SQLITE_IOERR;