From 1f800794c5c4bf01c54232713211077495c6ee73 Mon Sep 17 00:00:00 2001 From: Artem Khramov Date: Sun, 5 Jun 2022 13:34:15 +0200 Subject: [PATCH] Bump x/sys/unix A newer version of x/sys/unix updates the OpenBSD bindings which makes the `int8SliceToString` helper function obsolete. This change updates the x/sys/unix version Signed-off-by: Artem Khramov --- mount/go.mod | 2 +- mount/go.sum | 4 ++-- mountinfo/go.mod | 2 +- mountinfo/go.sum | 4 ++-- mountinfo/mountinfo_freebsdlike.go | 10 +++++----- mountinfo/mountinfo_openbsd.go | 21 +++++---------------- signal/go.mod | 2 +- signal/go.sum | 4 ++-- symlink/go.mod | 2 +- symlink/go.sum | 4 ++-- 10 files changed, 22 insertions(+), 33 deletions(-) diff --git a/mount/go.mod b/mount/go.mod index 492bf2bd..dde29ef2 100644 --- a/mount/go.mod +++ b/mount/go.mod @@ -4,5 +4,5 @@ go 1.16 require ( github.com/moby/sys/mountinfo v0.6.1 - golang.org/x/sys v0.0.0-20220412211240-33da011f77ad + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a ) diff --git a/mount/go.sum b/mount/go.sum index 6707188d..1faac7a7 100644 --- a/mount/go.sum +++ b/mount/go.sum @@ -1,5 +1,5 @@ github.com/moby/sys/mountinfo v0.6.1 h1:+H/KnGEAGRpTrEAqNVQ2AM3SiwMgJUt/TXj+Z8cmCIc= github.com/moby/sys/mountinfo v0.6.1/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/mountinfo/go.mod b/mountinfo/go.mod index 9fd6e214..e1bcdfe7 100644 --- a/mountinfo/go.mod +++ b/mountinfo/go.mod @@ -2,4 +2,4 @@ module github.com/moby/sys/mountinfo go 1.16 -require golang.org/x/sys v0.0.0-20220412211240-33da011f77ad +require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a diff --git a/mountinfo/go.sum b/mountinfo/go.sum index 7f2d82d5..af14a66e 100644 --- a/mountinfo/go.sum +++ b/mountinfo/go.sum @@ -1,2 +1,2 @@ -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/mountinfo/mountinfo_freebsdlike.go b/mountinfo/mountinfo_freebsdlike.go index 952787cd..ecaaa7a9 100644 --- a/mountinfo/mountinfo_freebsdlike.go +++ b/mountinfo/mountinfo_freebsdlike.go @@ -6,9 +6,9 @@ package mountinfo import "golang.org/x/sys/unix" func getMountinfo(entry *unix.Statfs_t) *Info { - var mountinfo Info - mountinfo.Mountpoint = unix.ByteSliceToString(entry.Mntonname[:]) - mountinfo.FSType = unix.ByteSliceToString(entry.Fstypename[:]) - mountinfo.Source = unix.ByteSliceToString(entry.Mntfromname[:]) - return &mountinfo + return &Info{ + Mountpoint: unix.ByteSliceToString(entry.Mntonname[:]), + FSType: unix.ByteSliceToString(entry.Fstypename[:]), + Source: unix.ByteSliceToString(entry.Mntfromname[:]), + } } diff --git a/mountinfo/mountinfo_openbsd.go b/mountinfo/mountinfo_openbsd.go index 78ea8cf3..f682c2d3 100644 --- a/mountinfo/mountinfo_openbsd.go +++ b/mountinfo/mountinfo_openbsd.go @@ -2,21 +2,10 @@ package mountinfo import "golang.org/x/sys/unix" -func int8SliceToString(is []int8) string { - var bs []byte - for _, i := range is { - if i == 0 { - break - } - bs = append(bs, byte(i)) - } - return string(bs) -} - func getMountinfo(entry *unix.Statfs_t) *Info { - var mountinfo Info - mountinfo.Mountpoint = int8SliceToString(entry.F_mntonname[:]) - mountinfo.FSType = int8SliceToString(entry.F_fstypename[:]) - mountinfo.Source = int8SliceToString(entry.F_mntfromname[:]) - return &mountinfo + return &Info{ + Mountpoint: unix.ByteSliceToString(entry.F_mntonname[:]), + FSType: unix.ByteSliceToString(entry.F_fstypename[:]), + Source: unix.ByteSliceToString(entry.F_mntfromname[:]), + } } diff --git a/signal/go.mod b/signal/go.mod index d504c561..b664ff21 100644 --- a/signal/go.mod +++ b/signal/go.mod @@ -2,4 +2,4 @@ module github.com/moby/sys/signal go 1.16 -require golang.org/x/sys v0.0.0-20220412211240-33da011f77ad +require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a diff --git a/signal/go.sum b/signal/go.sum index 7f2d82d5..af14a66e 100644 --- a/signal/go.sum +++ b/signal/go.sum @@ -1,2 +1,2 @@ -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/symlink/go.mod b/symlink/go.mod index ac8c77de..f7ab8a30 100644 --- a/symlink/go.mod +++ b/symlink/go.mod @@ -2,4 +2,4 @@ module github.com/moby/sys/symlink go 1.16 -require golang.org/x/sys v0.0.0-20220412211240-33da011f77ad +require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a diff --git a/symlink/go.sum b/symlink/go.sum index 7f2d82d5..af14a66e 100644 --- a/symlink/go.sum +++ b/symlink/go.sum @@ -1,2 +1,2 @@ -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=