use sys/unix package instead of syscall (#1340)

According to the golang docs, the syscall package is deprecated.
https://golang.org/pkg/syscall
This updates collectors to use the x/sys/unix package instead.
Also updates the vendored x/sys/unix module to latest.

Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
Paul Gier 2019-05-10 13:04:06 -05:00 committed by Ben Kochie
commit d0a66c4c40
39 changed files with 2942 additions and 19 deletions

View file

@ -18,9 +18,9 @@ package collector
import (
"fmt"
"syscall"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)
const (
@ -156,9 +156,9 @@ func NewTimexCollector() (Collector, error) {
func (c *timexCollector) Update(ch chan<- prometheus.Metric) error {
var syncStatus float64
var divisor float64
var timex = new(syscall.Timex)
var timex = new(unix.Timex)
status, err := syscall.Adjtimex(timex)
status, err := unix.Adjtimex(timex)
if err != nil {
return fmt.Errorf("failed to retrieve adjtimex stats: %v", err)
}