fix rename failed when rewrite public keys (#7761)
This commit is contained in:
parent
2594693a46
commit
4328d8e8d7
1 changed files with 3 additions and 1 deletions
|
@ -685,12 +685,14 @@ func rewriteAllPublicKeys(e Engine) error {
|
|||
}
|
||||
_, err = t.WriteString(line + "\n")
|
||||
if err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
}
|
||||
}
|
||||
defer f.Close()
|
||||
f.Close()
|
||||
}
|
||||
|
||||
t.Close()
|
||||
return os.Rename(tmpPath, fPath)
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue