diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-03-21 16:08:02 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-03-21 16:08:02 +0100 |
| commit | d60b9c6b0ec77c5d458a17467f1b4939cc2f6812 (patch) | |
| tree | cfc0a0b8ada856f1150d73700645e0e61c72ff74 /vm/vmimpl | |
| parent | a2d5b1c04d22c7db220cc795dc2b4d48b17437be (diff) | |
vm/vmimpl: refactor DiagnoseFree/OpenBSD
Make signatures of these functions match vm.Diagnose.
Both more flexible, less code, more reasonable.
Diffstat (limited to 'vm/vmimpl')
| -rw-r--r-- | vm/vmimpl/freebsd.go | 4 | ||||
| -rw-r--r-- | vm/vmimpl/openbsd.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/vm/vmimpl/freebsd.go b/vm/vmimpl/freebsd.go index c6074028a..f2ebfba56 100644 --- a/vm/vmimpl/freebsd.go +++ b/vm/vmimpl/freebsd.go @@ -12,7 +12,7 @@ import ( // is expected to be connected to a panicked FreeBSD kernel. If kernel // just hanged, we've lost connection or detected some non-panic // error, console still shows normal login prompt. -func DiagnoseFreeBSD(w io.Writer) bool { +func DiagnoseFreeBSD(w io.Writer) ([]byte, bool) { commands := []string{ "", "set $lines = 0", // disable pagination @@ -28,5 +28,5 @@ func DiagnoseFreeBSD(w io.Writer) bool { w.Write([]byte(c + "\n")) time.Sleep(1 * time.Second) } - return true + return nil, true } diff --git a/vm/vmimpl/openbsd.go b/vm/vmimpl/openbsd.go index 5e5ce3d3f..73460cb80 100644 --- a/vm/vmimpl/openbsd.go +++ b/vm/vmimpl/openbsd.go @@ -12,7 +12,7 @@ import ( // is expected to be connected to a paniced openbsd kernel. If kernel // just hanged, we've lost connection or detected some non-panic // error, console still shows normal login prompt. -func DiagnoseOpenBSD(w io.Writer) bool { +func DiagnoseOpenBSD(w io.Writer) ([]byte, bool) { commands := []string{ "", "set $lines = 0", // disable pagination @@ -30,5 +30,5 @@ func DiagnoseOpenBSD(w io.Writer) bool { w.Write([]byte(c + "\n")) time.Sleep(1 * time.Second) } - return true + return nil, true } |
