hostinfo: use Uname from golang.org/x/sys/unix in osVersionLinux

As already done in osVersionFreebsd. This will allow to use the Utsname
fields as []byte for easier conversion to string.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
pull/4755/head
Tobias Klauser 3 years ago committed by Brad Fitzpatrick
parent 928530a112
commit 2a61261a5a

@ -13,7 +13,6 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"strings" "strings"
"syscall"
"tailscale.com/util/lineread" "tailscale.com/util/lineread"
"tailscale.com/version/distro" "tailscale.com/version/distro"
@ -68,8 +67,8 @@ func osVersionLinux() string {
return nil return nil
}) })
var un syscall.Utsname var un unix.Utsname
syscall.Uname(&un) unix.Uname(&un)
var attrBuf strings.Builder var attrBuf strings.Builder
attrBuf.WriteString("; kernel=") attrBuf.WriteString("; kernel=")

Loading…
Cancel
Save