lib/fs: Avoid dirty offset read in fakefs (fixes #6584)
This commit is contained in:
+4
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user