mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-15 18:08:45 -07:00
lib/fs: Avoid dirty offset read in fakefs (fixes #6584)
This commit is contained in:
parent
5e1cd0e71a
commit
0e2a07d71a
@ -754,7 +754,10 @@ func (f *fakeFile) Seek(offset int64, whence int) (int64, error) {
|
||||
}
|
||||
|
||||
func (f *fakeFile) Write(p []byte) (int, error) {
|
||||
return f.WriteAt(p, f.offset)
|
||||
f.mut.Lock()
|
||||
offs := f.offset
|
||||
f.mut.Unlock()
|
||||
return f.WriteAt(p, offs)
|
||||
}
|
||||
|
||||
func (f *fakeFile) WriteAt(p []byte, off int64) (int, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user