aboutsummaryrefslogtreecommitdiffhomepage
path: root/sqlite
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2020-08-13 22:40:49 +0300
committerlevlam <levlam@telegram.org>2020-08-13 22:40:49 +0300
commite43f419a6fdf9cc66270b28297a698cf2f4c6776 (patch)
tree3bee8d19789bdf11d42d0342d64a738a9e3b94ce /sqlite
parent9592aac404d137400c7f9c1b52734222769dcecf (diff)
Patch SQLite ftruncate call only on Android.
GitOrigin-RevId: 930b58281ba5eab7d4f560e56b129d8b043fa455
Diffstat (limited to 'sqlite')
-rw-r--r--sqlite/sqlite/sqlite3.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sqlite/sqlite/sqlite3.c b/sqlite/sqlite/sqlite3.c
index e558fd1c7..85c45ac0d 100644
--- a/sqlite/sqlite/sqlite3.c
+++ b/sqlite/sqlite/sqlite3.c
@@ -42840,8 +42840,12 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
** -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
** 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) ){
+#else
+ if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){
+#endif
rc = unixLogError(SQLITE_IOERR_SHMOPEN,"ftruncate",pShmNode->zFilename);
}
}