mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-16 17:25:13 +00:00
File opened with O_TRUNC is not flushed - changed #291
This commit is contained in:
parent
0fdda61fb5
commit
c673d9d935
@ -2026,8 +2026,10 @@ static int s3fs_open(const char* path, struct fuse_file_info* fi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((unsigned int)fi->flags & O_TRUNC){
|
if((unsigned int)fi->flags & O_TRUNC){
|
||||||
st.st_size = 0;
|
if(0 != st.st_size){
|
||||||
needs_flush = true;
|
st.st_size = 0;
|
||||||
|
needs_flush = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)){
|
if(!S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)){
|
||||||
st.st_mtime = -1;
|
st.st_mtime = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user