blob: a8926762edd27b6ed0feb733120e08326a6a0700 [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001From b213da2d5fcc93cd24fc880c71c717d8e2ce2968 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 30 Nov 2019 18:43:21 -0800
4Subject: [PATCH] Fix build on 32bit arches with 64bit time_t
5
6time element is deprecated on new input_event structure in kernel's
7input.h [1]
8
9[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 utils/keytable/keytable.c | 7 ++++++-
15 1 file changed, 6 insertions(+), 1 deletion(-)
16
17diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
18index 6cb0217..59ff1ee 100644
19--- a/utils/keytable/keytable.c
20+++ b/utils/keytable/keytable.c
21@@ -53,6 +53,11 @@
22
23 # define N_(string) string
24
25+#ifndef input_event_sec
26+#define input_event_sec time.tv_sec
27+#define input_event_usec time.tv_usec
28+#endif
29+
30 struct input_keymap_entry_v2 {
31 #define KEYMAP_BY_INDEX (1 << 0)
32 u_int8_t flags;
33@@ -1533,7 +1538,7 @@ static void test_event(struct rc_device *rc_dev, int fd)
34
35 for (i = 0; i < rd / sizeof(struct input_event); i++) {
36 printf(_("%ld.%06ld: event type %s(0x%02x)"),
37- ev[i].time.tv_sec, ev[i].time.tv_usec,
38+ ev[i].input_event_sec, ev[i].input_event_usec,
39 get_event_name(events_type, ev[i].type), ev[i].type);
40
41 switch (ev[i].type) {