Skip to content

Commit 5a429a9

Browse files
internal/crashmonitor: update the type of the setCrashOutput function
1 parent ea995a9 commit 5a429a9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

internal/crashmonitor/crash_go123.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77

88
package crashmonitor
99

10-
import "runtime/debug"
10+
import (
11+
"os"
12+
"runtime/debug"
13+
)
1114

1215
func init() {
13-
setCrashOutput = debug.SetCrashOutput
16+
setCrashOutput = func(f *os.File) error {
17+
return debug.SetCrashOutput(f)
18+
}
1419
}

internal/crashmonitor/monitor.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ import (
2626
// TODO(adonovan): eliminate once go1.23+ is assured.
2727
func Supported() bool { return setCrashOutput != nil }
2828

29-
var setCrashOutput func(*os.File, debug.CrashOptions) error // = runtime.SetCrashOutput on go1.23+
29+
var setCrashOutput func(*os.File) error // = runtime.SetCrashOutput on go1.23+
3030

3131
// Parent sets up the parent side of the crashmonitor. It requires
3232
// exclusive use of a writable pipe connected to the child process's stdin.
3333
func Parent(pipe *os.File) {
3434
writeSentinel(pipe)
3535
// Ensure that we get pc=0x%x values in the traceback.
3636
debug.SetTraceback("system")
37-
setCrashOutput(pipe, debug.CrashOptions{})
37+
setCrashOutput(pipe)
3838
}
3939

4040
// Child runs the part of the crashmonitor that runs in the child process.

0 commit comments

Comments
 (0)