diff options
author | dan <dan@noemail.net> | 2013-03-05 15:27:34 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2013-03-05 15:27:34 +0000 |
commit | b83c21e600e57322278bb42cb1ac76dfd62cc7a1 (patch) | |
tree | 482866086b712d2b7b3d4443329d430224eb9d4b /src/os_unix.c | |
parent | e3664fb03cdfc6d2a98c26989d96f156560e6ba7 (diff) | |
download | sqlite-b83c21e600e57322278bb42cb1ac76dfd62cc7a1.tar.gz sqlite-b83c21e600e57322278bb42cb1ac76dfd62cc7a1.zip |
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
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index fca2f703d..ee13ae8ad 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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); } } |