Merge pull request #295 from ggtakec/fixissue

File opened with O_TRUNC is not flushed - changed #291
This commit is contained in:
Takeshi Nakatani 2015-11-08 14:14:42 +09:00
commit 5af6d4bd82

View File

@ -2026,8 +2026,10 @@ static int s3fs_open(const char* path, struct fuse_file_info* fi)
}
if((unsigned int)fi->flags & O_TRUNC){
st.st_size = 0;
needs_flush = true;
if(0 != st.st_size){
st.st_size = 0;
needs_flush = true;
}
}
if(!S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)){
st.st_mtime = -1;