diff options
author | drh <drh@noemail.net> | 2015-02-19 16:12:04 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-02-19 16:12:04 +0000 |
commit | a712b4bb97628129bf08b0bc35d91277bfa429b4 (patch) | |
tree | db29267d12c7fe93c087d06c6d4b8b8d98dba215 /src/os_unix.c | |
parent | 4bf66fd6f39c310eabd214b176b75d30a6073181 (diff) | |
download | sqlite-a712b4bb97628129bf08b0bc35d91277bfa429b4.tar.gz sqlite-a712b4bb97628129bf08b0bc35d91277bfa429b4.zip |
Remove a redundant call to statfs() in the xOpen() method of the unix VFS.
Also fix an unused local variable warning.
FossilOrigin-Name: 8215727dda384351765ab1d5c53ea80775b4ec65
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index d81618f61..522617212 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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 ){ |