Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame^] | 1 | From b213da2d5fcc93cd24fc880c71c717d8e2ce2968 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 30 Nov 2019 18:43:21 -0800 |
| 4 | Subject: [PATCH] Fix build on 32bit arches with 64bit time_t |
| 5 | |
| 6 | time element is deprecated on new input_event structure in kernel's |
| 7 | input.h [1] |
| 8 | |
| 9 | [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
| 14 | utils/keytable/keytable.c | 7 ++++++- |
| 15 | 1 file changed, 6 insertions(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c |
| 18 | index 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) { |