diff options
-rw-r--r-- | hwdb/60-evdev.hwdb | 22 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 6 | ||||
-rwxr-xr-x | test/udev-test.pl | 7 |
3 files changed, 28 insertions, 7 deletions
diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb index d060d81f61..598172256b 100644 --- a/hwdb/60-evdev.hwdb +++ b/hwdb/60-evdev.hwdb @@ -147,10 +147,19 @@ evdev:name:SynPS/2 Synaptics TouchPad*:dmi:*svnHewlett-Packard:pnHPPaviliondm4* # Lenovo ######################################### -# Lenovo X230 series -evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*X230* - EVDEV_ABS_01=::100 - EVDEV_ABS_36=::100 +# Lenovo P50 +evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*P50* + EVDEV_ABS_00=::44 + EVDEV_ABS_01=::67 + EVDEV_ABS_35=::44 + EVDEV_ABS_36=::67 + +# Lenovo T460 +evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*T460* + EVDEV_ABS_00=1266:5677:44 + EVDEV_ABS_01=1093:4832:65 + EVDEV_ABS_35=1266:5677:44 + EVDEV_ABS_36=1093:4832:65 # Lenovo T510 evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*T510* @@ -159,6 +168,11 @@ evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*T510* EVDEV_ABS_35=778:6239:72 EVDEV_ABS_36=841:5330:100 +# Lenovo X230 series +evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*X230* + EVDEV_ABS_01=::100 + EVDEV_ABS_36=::100 + ######################################### # Samsung ######################################### diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 8470456d4c..475856db6f 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -705,10 +705,10 @@ static void attr_subst_subdir(char *attr, size_t len) { for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) if (dent->d_name[0] != '.') { - char n[strlen(dent->d_name) + 1 + strlen(tail) + 1]; + char n[strlen(dent->d_name) + strlen(tail) + 1]; - strscpyl(n, sizeof n, dent->d_name, "/", tail, NULL); - if (faccessat(dirfd(dir), n, F_OK, 0)) { + strscpyl(n, sizeof n, dent->d_name, tail, NULL); + if (faccessat(dirfd(dir), n, F_OK, 0) == 0) { strscpyl(attr, len, path, n, NULL); break; } diff --git a/test/udev-test.pl b/test/udev-test.pl index 638c3e8f4e..b047493f6b 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -23,8 +23,10 @@ use strict; my $udev_bin = "./test-udev"; my $valgrind = 0; my $gdb = 0; +my $strace = 0; my $udev_bin_valgrind = "valgrind --tool=memcheck --leak-check=yes --track-origins=yes --quiet $udev_bin"; my $udev_bin_gdb = "gdb --args $udev_bin"; +my $udev_bin_strace = "strace -efile $udev_bin"; my $udev_dev = "test/dev"; my $udev_run = "test/run"; my $udev_rules_dir = "$udev_run/udev/rules.d"; @@ -1330,6 +1332,8 @@ sub udev { system("$udev_bin_valgrind $action $devpath"); } elsif ($gdb > 0) { system("$udev_bin_gdb $action $devpath"); + } elsif ($strace > 0) { + system("$udev_bin_strace $action $devpath"); } else { system("$udev_bin", "$action", "$devpath"); } @@ -1509,6 +1513,9 @@ foreach my $arg (@ARGV) { } elsif ($arg =~ m/--gdb/) { $gdb = 1; printf("using gdb\n"); + } elsif ($arg =~ m/--strace/) { + $strace = 1; + printf("using strace\n"); } else { push(@list, $arg); } |