1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Do not attempt to set the permissions on an existing journal or wal file. Do this only immediately after creating a new file (or opening one zero bytes in size).

FossilOrigin-Name: 1d8086902ee96347491bce5ec04dc92ccd42efa1
This commit is contained in:
dan
2013-03-05 15:27:34 +00:00
parent e3664fb03c
commit b83c21e600
4 changed files with 13 additions and 13 deletions

View File

@@ -552,7 +552,10 @@ static int robust_open(const char *z, int f, mode_t m){
if( fd>=0 ){
if( m!=0 ){
struct stat statbuf;
if( osFstat(fd, &statbuf)==0 && (statbuf.st_mode&0777)!=m ){
if( osFstat(fd, &statbuf)==0
&& statbuf.st_size==0
&& statbuf.st_mode&0777!=m
){
osFchmod(fd, m);
}
}