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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user