mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-23 17:27:14 +09:00
backup: Perform write process safe
This commit is contained in:
@@ -103,6 +103,9 @@ func (b *Buffer) overwrite(name string, withSudo bool) (int, error) {
|
||||
|
||||
var size int
|
||||
fwriter := func(file io.Writer) error {
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
|
||||
if len(b.lines) == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user