mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 15:38:27 +00:00
Delete cfgFile before renaming it on Windows
This commit is contained in:
parent
043dea760f
commit
8f41d90ab1
7
main.go
7
main.go
@ -328,6 +328,13 @@ func saveConfigLoop(cfgFile string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
err := os.Remove(cfgFile)
|
||||||
|
if err != nil && !os.IsNotExist(err) {
|
||||||
|
warnln(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = os.Rename(cfgFile+".tmp", cfgFile)
|
err = os.Rename(cfgFile+".tmp", cfgFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
warnln(err)
|
warnln(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user