diff options
author | drh <drh@noemail.net> | 2010-06-21 12:47:41 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-06-21 12:47:41 +0000 |
commit | 24f0f7716a8963454d77e0224c98dc76f1eebfd2 (patch) | |
tree | f76f3b8d9477bb70be62d337bd579479b4d23078 /src/os_unix.c | |
parent | 19515c8da1df2330c7689315dcd70fc02a4b4e28 (diff) | |
parent | e08341c664e41bb084a7a95bfb47b90b13868694 (diff) | |
download | sqlite-24f0f7716a8963454d77e0224c98dc76f1eebfd2.tar.gz sqlite-24f0f7716a8963454d77e0224c98dc76f1eebfd2.zip |
Merge the experimental UNDELETABLE_WHEN_OPEN optimization into the trunk.
FossilOrigin-Name: ee0acef1faffd480fd2136f81fb2b6f6a17b5388
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index e949c20cd..77aafccce 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4604,6 +4604,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; } |