The struct input_event is not y2038 safe.
Update the struct according to the kernel patch:
https://lkml.org/lkml/2018/1/6/324

Signed-off-by: Deepa Dinamani <deepa.ker...@gmail.com>
---
 src/core.c        | 3 ++-
 test/mtdev-test.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/core.c b/src/core.c
index 87ef420..c3f7a68 100644
--- a/src/core.c
+++ b/src/core.c
@@ -251,7 +251,8 @@ static void push_slot_changes(struct mtdev_state *state,
                        count++;
        if (!count)
                return;
-       ev.time = syn->time;
+       ev.input_event_sec = syn->input_event_sec;
+       ev.input_event_usec = syn->input_event_usec;
        ev.type = EV_ABS;
        ev.code = ABS_MT_SLOT;
        ev.value = slot;
diff --git a/test/mtdev-test.c b/test/mtdev-test.c
index 1b3e4f2..9055863 100644
--- a/test/mtdev-test.c
+++ b/test/mtdev-test.c
@@ -47,7 +47,7 @@ static void print_event(const struct input_event *ev)
 {
        static const mstime_t ms = 1000;
        static int slot;
-       mstime_t evtime = ev->time.tv_usec / ms + ev->time.tv_sec * ms;
+       mstime_t evtime = ev->input_event_usec / ms + ev->input_event_sec * ms;
        if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT)
                slot = ev->value;
        fprintf(stderr, "%012llx %02d %01d %04x %d\n",
-- 
2.14.1

_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

Reply via email to