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

Changes to make WAL more robust against SHM locking failures and OOM errors.

FossilOrigin-Name: ebf4041383c3cdddb5861960359abd209d4a1028
This commit is contained in:
drh
2010-06-02 14:45:51 +00:00
parent 048129dcb9
commit aab4c02e47
5 changed files with 47 additions and 26 deletions

View File

@@ -3362,7 +3362,7 @@ static int unixShmOpen(
rc = SQLITE_OK;
if( unixShmSystemLock(pShmNode, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){
if( ftruncate(pShmNode->h, 0) ){
rc = SQLITE_IOERR;
rc = SQLITE_IOERR_SHMOPEN;
}
}
if( rc==SQLITE_OK ){
@@ -3469,7 +3469,7 @@ static int unixShmSize(
if( reqSize<=(int)sStat.st_size ) break;
}else{
*pNewSize = 0;
rc = SQLITE_IOERR;
rc = SQLITE_IOERR_SHMSIZE;
break;
}
rc = ftruncate(pShmNode->h, reqSize);