Skip to content

Commit

Permalink
Merge pull request #2 from stolowski/fix-subsystem-with-existingdevices
Browse files Browse the repository at this point in the history
Thank you for your contribution, the implemetnation is valid and have no negative impact on the existing code, go merge ! Cheers 

Fixes #1
  • Loading branch information
pilebones committed Mar 15, 2018
2 parents e232f4f + 0220664 commit 0ab5fc3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crawler/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ func ExistingDevices(queue chan Device, errors chan error, matcher netlink.Match
return err
}

if matcher == nil || matcher.EvaluateEnv(env) {
kObj := filepath.Dir(path)

kObj := filepath.Dir(path)
// Append to env subsystem if existing
if link, err := os.Readlink(kObj + "/subsystem"); err == nil {
env["SUBSYSTEM"] = filepath.Base(link)
}

// Append to env subsystem if existing
if link, err := os.Readlink(kObj + "/subsystem"); err == nil {
env["SUBSYSTEM"] = filepath.Base(link)
}
if matcher == nil || matcher.EvaluateEnv(env) {

queue <- Device{
KObj: kObj,
Expand Down

0 comments on commit 0ab5fc3

Please sign in to comment.