Patch SQLite ftruncate call only on Android.
GitOrigin-RevId: 930b58281ba5eab7d4f560e56b129d8b043fa455
This commit is contained in:
parent
9592aac404
commit
e43f419a6f
6
sqlite/sqlite/sqlite3.c
vendored
6
sqlite/sqlite/sqlite3.c
vendored
|
@ -42840,8 +42840,12 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
|
||||||
** -shm header size) rather than 0 as a system debugging aid, to
|
** -shm header size) rather than 0 as a system debugging aid, to
|
||||||
** help detect if a -shm file truncation is legitimate or is the work
|
** help detect if a -shm file truncation is legitimate or is the work
|
||||||
** or a rogue process. */
|
** or a rogue process. */
|
||||||
/* Fix SQLite DB corruption on some Samsung devices (3 changed to 0) */
|
#ifdef __ANDROID__
|
||||||
|
/* Fix SQLite DB corruption on some Samsung devices */
|
||||||
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 0) ){
|
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 0) ){
|
||||||
|
#else
|
||||||
|
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){
|
||||||
|
#endif
|
||||||
rc = unixLogError(SQLITE_IOERR_SHMOPEN,"ftruncate",pShmNode->zFilename);
|
rc = unixLogError(SQLITE_IOERR_SHMOPEN,"ftruncate",pShmNode->zFilename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user