File opened with O_TRUNC is not flushed - changed #291

This commit is contained in:
Takeshi Nakatani 2015-11-08 04:55:17 +00:00
parent 0fdda61fb5
commit c673d9d935

View File

@ -2026,9 +2026,11 @@ static int s3fs_open(const char* path, struct fuse_file_info* fi)
}
if((unsigned int)fi->flags & O_TRUNC){
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;
}