Handle empty as full empty and fix discarding of previous results
This commit is contained in:
parent
ecbda0ce3a
commit
b98771012d
13
loc.go
13
loc.go
|
@ -36,8 +36,8 @@ func (i *iface) ProcLoc() (err error) {
|
|||
}
|
||||
|
||||
var (
|
||||
pci, usb string
|
||||
procmode int
|
||||
pci, usb, tmp string
|
||||
procmode int
|
||||
)
|
||||
for _, v := range strings.Split(devpath, "/") {
|
||||
if strings.HasPrefix(v, "pci") {
|
||||
|
@ -51,18 +51,23 @@ func (i *iface) ProcLoc() (err error) {
|
|||
switch procmode {
|
||||
case PathProcPCI:
|
||||
{
|
||||
if pci, err = i.ProcPCI(v); err != nil {
|
||||
if tmp, err = i.ProcPCI(v); err != nil {
|
||||
continue
|
||||
}
|
||||
pci = tmp
|
||||
}
|
||||
case PathProcUSB:
|
||||
{
|
||||
if usb, err = i.ProcUSB(v); err != nil {
|
||||
if tmp, err = i.ProcUSB(v); err != nil {
|
||||
continue
|
||||
}
|
||||
usb = tmp
|
||||
}
|
||||
}
|
||||
}
|
||||
if pci == "" && usb == "" {
|
||||
return
|
||||
}
|
||||
i.names[IfNameLoc] = strings.Join([]string{i.pfx, pci, usb}, "")
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue