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

Adjust unixPosixAdvisorLocks() to use redirectable system calls so that

it can be tested.

FossilOrigin-Name: eafe88b782875cd839fc27da509830e3e1d95781c686e27242a2844910203a42
This commit is contained in:
drh
2025-10-25 18:40:18 +00:00
parent c053b57716
commit 7be565f0cc
3 changed files with 10 additions and 10 deletions

View File

@@ -648,12 +648,12 @@ static int unixPosixAdvisoryLocks(
/* 012 4 678 01234 */
memcpy(a, "---/-.---.-----", 16);
sqlite3_snprintf(sizeof(z), z, "/proc/%d/fdinfo/%d", getpid(), fd);
in = open(z, O_RDONLY);
in = osOpen(z, O_RDONLY, 0);
if( in<0 ){
return SQLITE_ERROR_UNABLE;
}
n = read(in, z, sizeof(z)-1);
close(in);
n = osRead(in, z, sizeof(z)-1);
osClose(in);
if( n<=0 ) return SQLITE_ERROR_UNABLE;
z[n] = 0;