From 43597ead30c23addf678befb21486a1ebecebe9b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 27 Dec 2013 16:30:20 +0100 Subject: do not fill logs with "Cannot open /dev/input/eventX" (mga#8232) issue introduced in commit eea2f8ef9ddf7e461702d8fda0b8e98e623694c2 by Arnaud Patard on Mar 18 2011 --- perl-install/NEWS | 1 + perl-install/detect_devices.pm | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 61efd0828..a65d4164f 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,6 +1,7 @@ - detecting input devices: o display the real accessed /dev/input/eventX file (mga#8232) o do not crash if /dev/input/eventX doesn't exist (mga#10296) + o do not fill logs with "Cannot open /dev/input/eventX" (mga#8232) - draksec: o use expanders for clarity diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 76e6e2a24..83011ddc6 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -568,8 +568,13 @@ sub getInputDevices() { if (!$> && ! -f "/dev/input/$event") { devices::make("/dev/input/$event"); } - my @KEYS = c::EVIocGBitKey("/dev/input/$event"); - $device->{SIDE} = 1 if $KEYS[0] & (1 << 0x13); + if (-r "/dev/input/$event") { + my @KEYS = c::EVIocGBitKey("/dev/input/$event"); + $device->{SIDE} = 1 if $KEYS[0] & (1 << 0x13); + } else { + my $KEY = hex($1); + $device->{SIDE} = 1 if $KEY & (1 << 0x13); + } } elsif (/^\s*$/) { push @devices, $device if $device; -- cgit v1.2.1