summaryrefslogtreecommitdiff
path: root/user/libinput/time64.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-01-19 22:34:27 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-01-19 22:34:27 +0000
commit97914b333fb31bb77d33573d19fb64503ec4bf99 (patch)
tree8fa31d00fdc027c75edac603d6adc138a2413e62 /user/libinput/time64.patch
parent44d3e0b7194a9fa97ed58a4c437c168749b8c58c (diff)
downloadpackages-97914b333fb31bb77d33573d19fb64503ec4bf99.tar.gz
packages-97914b333fb31bb77d33573d19fb64503ec4bf99.tar.bz2
packages-97914b333fb31bb77d33573d19fb64503ec4bf99.tar.xz
packages-97914b333fb31bb77d33573d19fb64503ec4bf99.zip
user/libinput: Fix input_event code for time64 compatibility
Diffstat (limited to 'user/libinput/time64.patch')
-rw-r--r--user/libinput/time64.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/user/libinput/time64.patch b/user/libinput/time64.patch
new file mode 100644
index 000000000..47833b6ee
--- /dev/null
+++ b/user/libinput/time64.patch
@@ -0,0 +1,49 @@
+From 2e15e1f56d673626d518760c1b7997543bb01fea Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Sun, 19 Jan 2020 16:01:57 -0600
+Subject: [PATCH] evdev-fallback: Use input_event_init for fallback
+
+Old-style field initialisation ignores the 64-bit time_t change in
+Linux UAPI, which causes the structure to be incompletely initialised
+on 32-bit systems with the 64-bit time_t kernel headers.
+
+This patch uses the input_event_init helper from the original 64-bit
+time_t enablement patch.
+
+Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
+Fixes: 5dc1a7ebd ("Adjust for 64bit time_t for 32bit architectures")
+See-Also: libinput/libinput!346
+---
+ src/evdev-fallback.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c
+index 651f0111..99c87c87 100644
+--- a/src/evdev-fallback.c
++++ b/src/evdev-fallback.c
+@@ -29,6 +29,7 @@
+ #include <mtdev-plumbing.h>
+
+ #include "evdev-fallback.h"
++#include "util-input-event.h"
+
+ static void
+ fallback_keyboard_notify_key(struct fallback_dispatch *dispatch,
+@@ -701,10 +702,10 @@ fallback_lid_keyboard_event(uint64_t time,
+ if (dispatch->lid.reliability == RELIABILITY_WRITE_OPEN) {
+ int fd = libevdev_get_fd(dispatch->device->evdev);
+ int rc;
+- struct input_event ev[2] = {
+- {{ 0, 0 }, EV_SW, SW_LID, 0 },
+- {{ 0, 0 }, EV_SYN, SYN_REPORT, 0 },
+- };
++ struct input_event ev[2];
++
++ ev[0] = input_event_init(0, EV_SW, SW_LID, 0);
++ ev[1] = input_event_init(0, EV_SYN, SYN_REPORT, 0);
+
+ rc = write(fd, ev, sizeof(ev));
+
+--
+2.24.1
+