Skip to content

Commit

Permalink
xmm2usb: skip vendor files with no device
Browse files Browse the repository at this point in the history
Avoids a harmless error message eg. when encountering certain input
devices which have a "vendor" file (with a different meaning to what the
script expects) but no "device".
  • Loading branch information
abrasive committed Oct 28, 2019
1 parent 5091c24 commit 55f2dc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xmm2usb
Expand Up @@ -10,6 +10,8 @@ die() {
for path in `find /sys/devices/pci0000:00 -name vendor`; do
path="${path%/vendor}"

[ -e "${path}/device" ] || continue

read -r vendor < "${path}/vendor" || continue
read -r device < "${path}/device" || continue
[ "${vendor}" = 0x8086 -a "${device}" = 0x7360 ] || continue
Expand Down

0 comments on commit 55f2dc1

Please sign in to comment.