aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-06-18 11:10:06 +0000
committerdan <dan@noemail.net>2010-06-18 11:10:06 +0000
commit83acd423a1bca7c95cae4a4c9af918e3ebc00d59 (patch)
tree749f9295baadf657a78953a8d7577e61765d7c1c /src/os_unix.c
parentcd27cffa97a084fb4911ea5d669e11b8aabd0c1f (diff)
downloadsqlite-83acd423a1bca7c95cae4a4c9af918e3ebc00d59.tar.gz
sqlite-83acd423a1bca7c95cae4a4c9af918e3ebc00d59.zip
Change the implementation of the unix implementation of xAccess() so that it returns 0 (does not exist) to an SQLITE_ACCESS_EXISTS query on a file that exists but is zero bytes in size.
FossilOrigin-Name: 077b0e5bcd849130c8df373fc2134c4b44351882
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 574f48d18..9966ed609 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4618,6 +4618,12 @@ static int unixAccess(
assert(!"Invalid flags argument");
}
*pResOut = (access(zPath, amode)==0);
+ if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
+ struct stat buf;
+ if( 0==stat(zPath, &buf) && buf.st_size==0 ){
+ *pResOut = 0;
+ }
+ }
return SQLITE_OK;
}