diff --git a/disk/disk_openbsd.go b/disk/disk_openbsd.go index e6755803f..f71862fa4 100644 --- a/disk/disk_openbsd.go +++ b/disk/disk_openbsd.go @@ -87,7 +87,11 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC if err != nil { continue } - name := common.IntToString(d.Name[:]) + uint8Name := make([]uint8, len(d.Name)) + for i, v := range d.Name { + uint8Name[i] = uint8(v) + } + name := common.UintToString(uint8Name) if len(names) > 0 && !common.StringsHas(names, name) { continue diff --git a/process/process_openbsd.go b/process/process_openbsd.go index 0404b4bae..947a73dde 100644 --- a/process/process_openbsd.go +++ b/process/process_openbsd.go @@ -46,7 +46,11 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { if err != nil { return "", err } - name := common.IntToString(k.Comm[:]) + uint8Name := make([]uint8, len(k.Comm)) + for i, v := range k.Comm { + uint8Name[i] = uint8(v) + } + name := common.UintToString(uint8Name) if len(name) >= 15 { cmdlineSlice, err := p.CmdlineSliceWithContext(ctx) diff --git a/v3/disk/disk_openbsd.go b/v3/disk/disk_openbsd.go index 24324a4fd..753090183 100644 --- a/v3/disk/disk_openbsd.go +++ b/v3/disk/disk_openbsd.go @@ -87,7 +87,11 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC if err != nil { continue } - name := common.IntToString(d.Name[:]) + uint8Name := make([]uint8, len(d.Name)) + for i, v := range d.Name { + uint8Name[i] = uint8(v) + } + name := common.UintToString(uint8Name) if len(names) > 0 && !common.StringsHas(names, name) { continue diff --git a/v3/process/process_openbsd.go b/v3/process/process_openbsd.go index 7325f093e..1372b856f 100644 --- a/v3/process/process_openbsd.go +++ b/v3/process/process_openbsd.go @@ -46,7 +46,11 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { if err != nil { return "", err } - name := common.IntToString(k.Comm[:]) + uint8Name := make([]uint8, len(k.Comm)) + for i, v := range k.Comm { + uint8Name[i] = uint8(v) + } + name := common.UintToString(uint8Name) if len(name) >= 15 { cmdlineSlice, err := p.CmdlineSliceWithContext(ctx)