fix history rewrite replace origin file

This commit is contained in:
Cheney 2015-10-08 18:11:21 +08:00
parent d0699b888b
commit 9f55547f9b
1 changed files with 5 additions and 0 deletions

View File

@ -88,6 +88,11 @@ func (o *opHistory) HistoryRewrite() {
} }
buf.Flush() buf.Flush()
// replace history file
if err = os.Rename(tmpFile, o.cfg.HistoryFile); err != nil {
return
}
if o.fd != nil { if o.fd != nil {
o.fd.Close() o.fd.Close()
} }