summaryrefslogtreecommitdiff
path: root/x11/evtest/files/patch-evtest.c
diff options
context:
space:
mode:
authorMateusz Piotrowski <0mp@FreeBSD.org>2020-11-12 14:07:06 +0000
committerMateusz Piotrowski <0mp@FreeBSD.org>2020-11-12 14:07:06 +0000
commite75fa619c76225663d039bf99bcb98d49c5cf219 (patch)
tree80af7f00c613742d0d7a2b59d7ce291b7086d889 /x11/evtest/files/patch-evtest.c
parentMake sure that ARCH variable is defined at the time of check. (diff)
Add x11/evtest
evtest is a tool to print evdev kernel events. It reads directly from the kernel device and prints a device description and the events with the value and the symbolic name. WWW: https://gitlab.freedesktop.org/libevdev/evtest Differential Revision: https://reviews.freebsd.org/D27190
Diffstat (limited to 'x11/evtest/files/patch-evtest.c')
-rw-r--r--x11/evtest/files/patch-evtest.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/x11/evtest/files/patch-evtest.c b/x11/evtest/files/patch-evtest.c
new file mode 100644
index 000000000000..b46cbf93794d
--- /dev/null
+++ b/x11/evtest/files/patch-evtest.c
@@ -0,0 +1,44 @@
+--- evtest.c.orig 2019-08-02 18:14:30 UTC
++++ evtest.c
+@@ -43,7 +43,7 @@
+ #include <config.h>
+ #endif
+
+-#include <linux/version.h>
++#include <sys/syslimits.h>
+ #include <linux/input.h>
+
+ #include <string.h>
+@@ -875,7 +875,7 @@ static char* scan_devices(void)
+ char *filename;
+ int max_device = 0;
+
+- ndev = scandir(DEV_INPUT_EVENT, &namelist, is_event_device, versionsort);
++ ndev = scandir(DEV_INPUT_EVENT, &namelist, is_event_device, alphasort);
+ if (ndev <= 0)
+ return NULL;
+
+@@ -923,7 +923,7 @@ static int version(void)
+ #ifndef PACKAGE_VERSION
+ #define PACKAGE_VERSION "<version undefined>"
+ #endif
+- printf("%s %s\n", program_invocation_short_name, PACKAGE_VERSION);
++ printf("%s %s\n", getprogname(), PACKAGE_VERSION);
+ return EXIT_SUCCESS;
+ }
+
+@@ -935,12 +935,12 @@ static int usage(void)
+ {
+ printf("USAGE:\n");
+ printf(" Capture mode:\n");
+- printf(" %s [--grab] /dev/input/eventX\n", program_invocation_short_name);
++ printf(" %s [--grab] /dev/input/eventX\n", getprogname());
+ printf(" --grab grab the device for exclusive access\n");
+ printf("\n");
+ printf(" Query mode: (check exit code)\n");
+ printf(" %s --query /dev/input/eventX <type> <value>\n",
+- program_invocation_short_name);
++ getprogname());
+
+ printf("\n");
+ printf("<type> is one of: EV_KEY, EV_SW, EV_LED, EV_SND\n");