aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2013-03-05 16:54:45 +0000
committerdan <dan@noemail.net>2013-03-05 16:54:45 +0000
commit77dfe91662d194c436323fd221ec0133109fe715 (patch)
treec066aa3b1b4ba66c13e2ab1c052d0c9108c559b8 /src/os_unix.c
parente1df4e31ec386c7c00dc913926e01b312a592203 (diff)
parentb83c21e600e57322278bb42cb1ac76dfd62cc7a1 (diff)
downloadsqlite-77dfe91662d194c436323fd221ec0133109fe715.tar.gz
sqlite-77dfe91662d194c436323fd221ec0133109fe715.zip
Merge experimental branch with trunk.
FossilOrigin-Name: 4e6e07a60e543d5d1727cde27ab11e156202a1b8
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c5
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);
}
}