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

Additional comments explaining what unixIsSharingShmNode() does. No

changes to code.

FossilOrigin-Name: 819fc87385fd5be8a847492478f4c4f247f64edf7c7161b641bfbac6b658bec5
This commit is contained in:
drh
2025-10-28 01:28:20 +00:00
parent db0d47b749
commit 6cc222c3be
3 changed files with 21 additions and 7 deletions

View File

@@ -4651,6 +4651,20 @@ static int unixFcntlExternalReader(unixFile *pFile, int *piOut){
** then return true. Return false if either pFile does not have a -shm
** file open or if it is the only connection to that -shm file across the
** entire system.
**
** This routine is not required for correct operation. It can always return
** false and SQLite will continue to operate according to spec. However,
** when this routine does its job, it adds extra robustness in cases
** where database file locks have been erroneously deleted in a WAL-mode
** database by doing close(open(DATABASE_PATHNAME)) or similar.
**
** With false negatives, SQLite still operates to spec, though with less
** robustness. With false positives, the last database connection on a
** WAL-mode database will fail to unlink the -wal and -shm files, which
** is annoying but harmless. False positives will also prevent a database
** connection from running "PRAGMA journal_mode=DELETE" in order to take
** the database out of WAL mode, which is perhaps more serious, but is
** still not a disaster.
*/
static int unixIsSharingShmNode(unixFile *pFile){
int rc;