diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go index e99375f538..df60145d1e 100644 --- a/src/cmd/dist/util.go +++ b/src/cmd/dist/util.go @@ -249,6 +249,7 @@ func writefile(text, file string, flag int) { if flag&writeExec != 0 { mode = 0777 } + xremove(file) // in case of symlink tricks by misc/reboot test err := ioutil.WriteFile(file, new, mode) if err != nil { fatalf("%v", err)