Skip to content

Commit 1547f11

Browse files
committed
remove old pprof file without checking if it exists
Signed-off-by: Spike Curtis <[email protected]>
1 parent 7b8618c commit 1547f11

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pprof_unix.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ func servePprof() {
2626
}
2727

2828
// remove the old file, if it exists. It's probably from the last run of the provider
29-
if _, err = os.Stat("../.coder/pprof"); err == nil {
30-
if err = os.Remove("../.coder/pprof"); err != nil {
31-
return
32-
}
29+
if err = os.Remove("../.coder/pprof"); err != nil && !os.IsNotExist(err) {
30+
return
3331
}
3432
l, err := net.Listen("unix", "../.coder/pprof")
3533
if err != nil {

0 commit comments

Comments
 (0)