Skip to content

Commit

Permalink
Bump x/sys/unix
Browse files Browse the repository at this point in the history
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 <akhramov@pm.me>
  • Loading branch information
akhramov committed Jun 5, 2022
1 parent ad57f78 commit 2e48ad7
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion mount/go.mod
Expand Up @@ -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
)
2 changes: 2 additions & 0 deletions mount/go.sum
Expand Up @@ -3,3 +3,5 @@ github.com/moby/sys/mountinfo v0.6.1/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdx
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=
2 changes: 1 addition & 1 deletion mountinfo/go.mod
Expand Up @@ -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
2 changes: 2 additions & 0 deletions mountinfo/go.sum
@@ -1,2 +1,4 @@
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=
10 changes: 5 additions & 5 deletions mountinfo/mountinfo_freebsdlike.go
Expand Up @@ -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[:]),
}
}
23 changes: 6 additions & 17 deletions mountinfo/mountinfo_openbsd.go
Expand Up @@ -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[:]),
}
}
2 changes: 1 addition & 1 deletion signal/go.mod
Expand Up @@ -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
2 changes: 2 additions & 0 deletions signal/go.sum
@@ -1,2 +1,4 @@
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=
2 changes: 1 addition & 1 deletion symlink/go.mod
Expand Up @@ -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
2 changes: 2 additions & 0 deletions symlink/go.sum
@@ -1,2 +1,4 @@
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=

0 comments on commit 2e48ad7

Please sign in to comment.