mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Remove a redundant call to statfs() in the xOpen() method of the unix VFS.
Also fix an unused local variable warning. FossilOrigin-Name: 8215727dda384351765ab1d5c53ea80775b4ec65
This commit is contained in:
@@ -1783,14 +1783,13 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){
|
||||
** 4: [RRRR.]
|
||||
*/
|
||||
if( eFileLock==SHARED_LOCK ){
|
||||
int tErrno; /* Error code from system call errors */
|
||||
|
||||
#if !defined(__APPLE__) || !SQLITE_ENABLE_LOCKING_STYLE
|
||||
(void)handleNFSUnlock;
|
||||
assert( handleNFSUnlock==0 );
|
||||
#endif
|
||||
#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE
|
||||
if( handleNFSUnlock ){
|
||||
int tErrno; /* Error code from system call errors */
|
||||
off_t divSize = SHARED_SIZE - 1;
|
||||
|
||||
lock.l_type = F_UNLCK;
|
||||
@@ -5878,19 +5877,6 @@ static int unixOpen(
|
||||
if( envforce!=NULL ){
|
||||
useProxy = atoi(envforce)>0;
|
||||
}else{
|
||||
if( statfs(zPath, &fsInfo) == -1 ){
|
||||
/* In theory, the close(fd) call is sub-optimal. If the file opened
|
||||
** with fd is a database file, and there are other connections open
|
||||
** on that file that are currently holding advisory locks on it,
|
||||
** then the call to close() will cancel those locks. In practice,
|
||||
** we're assuming that statfs() doesn't fail very often. At least
|
||||
** not while other file descriptors opened by the same process on
|
||||
** the same file are working. */
|
||||
storeLastErrno(p, errno);
|
||||
robust_close(p, fd, __LINE__);
|
||||
rc = SQLITE_IOERR_ACCESS;
|
||||
goto open_finished;
|
||||
}
|
||||
useProxy = !(fsInfo.f_flags&MNT_LOCAL);
|
||||
}
|
||||
if( useProxy ){
|
||||
|
||||
Reference in New Issue
Block a user