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:
drh 2015-02-19 16:12:04 +00:00
parent 4bf66fd6f3
commit a712b4bb97
3 changed files with 8 additions and 22 deletions

View File

@ -1,5 +1,5 @@
C Move\sthe\sos_unix.c\sfile\scloser\sto\sapple-osx.
D 2015-02-19T02:43:02.884
C Remove\sa\sredundant\scall\sto\sstatfs()\sin\sthe\sxOpen()\smethod\sof\sthe\sunix\sVFS.\nAlso\sfix\san\sunused\slocal\svariable\swarning.
D 2015-02-19T16:12:04.194
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 6b9e7677829aa94b9f30949656e27312aefb9a46
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -214,7 +214,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c 9922c8f5b2e32c0f0be2292feca5f72d88f6a833
F src/os_unix.c 16ad795ef98966d9bdb3c967585fdadf9a2cfcb9
F src/os_win.c 8223e7db5b7c4a81d8b161098ac3959400434cdb
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
@ -1239,7 +1239,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 28284ccc0d7301503f6d2d7bee9093738d52e331
R de5d87b1cb4f744ff7cb90b036adcd40
P 81f242e338d6122e27aad86986bfd140012c6582
R 02e43373b368494c6578c4a98382bae8
U drh
Z 45842533d15e073070e1f1a9e9241135
Z 3ab050a0ccd2941539e2053f07648364

View File

@ -1 +1 @@
81f242e338d6122e27aad86986bfd140012c6582
8215727dda384351765ab1d5c53ea80775b4ec65

View File

@ -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 ){