From d60b9c6b0ec77c5d458a17467f1b4939cc2f6812 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 21 Mar 2020 16:08:02 +0100 Subject: vm/vmimpl: refactor DiagnoseFree/OpenBSD Make signatures of these functions match vm.Diagnose. Both more flexible, less code, more reasonable. --- vm/vmimpl/freebsd.go | 4 ++-- vm/vmimpl/openbsd.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'vm/vmimpl') 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 } -- cgit mrf-deployment