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 6, 2022
1 parent ad57f78 commit 1f80079
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 33 deletions.
2 changes: 1 addition & 1 deletion mount/go.mod
Original file line number Diff line number Diff line change
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
)
4 changes: 2 additions & 2 deletions mount/go.sum
Original file line number Diff line number Diff line change
@@ -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=
2 changes: 1 addition & 1 deletion mountinfo/go.mod
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions mountinfo/go.sum
Original file line number Diff line number Diff line change
@@ -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=
10 changes: 5 additions & 5 deletions mountinfo/mountinfo_freebsdlike.go
Original file line number Diff line number Diff line change
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[:]),
}
}
21 changes: 5 additions & 16 deletions mountinfo/mountinfo_openbsd.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions signal/go.sum
Original file line number Diff line number Diff line change
@@ -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=
2 changes: 1 addition & 1 deletion symlink/go.mod
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions symlink/go.sum
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit 1f80079

Please sign in to comment.