summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2018-01-15 16:21:08 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2018-04-12 15:23:22 +1000
commit3c6766c86246c1594096b23e769079e639fc75ad (patch)
treedbc8de47c4f661b136c86620409c164fab3cc974 /tools
parent501f739564c2da6f030a64bf0c3356eb176421df (diff)
downloadlibevdev-3c6766c86246c1594096b23e769079e639fc75ad.tar.gz
Update struct input_event
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.kernel@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/libevdev-events.c8
-rw-r--r--tools/mouse-dpi-tool.c8
2 files changed, 5 insertions, 11 deletions
diff --git a/tools/libevdev-events.c b/tools/libevdev-events.c
index 3ce23f1..dfd841f 100644
--- a/tools/libevdev-events.c
+++ b/tools/libevdev-events.c
@@ -112,13 +112,13 @@ print_event(struct input_event *ev)
{
if (ev->type == EV_SYN)
printf("Event: time %ld.%06ld, ++++++++++++++++++++ %s +++++++++++++++\n",
- ev->time.tv_sec,
- ev->time.tv_usec,
+ ev->input_event_sec,
+ ev->input_event_usec,
libevdev_event_type_get_name(ev->type));
else
printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n",
- ev->time.tv_sec,
- ev->time.tv_usec,
+ ev->input_event_sec,
+ ev->input_event_usec,
ev->type,
libevdev_event_type_get_name(ev->type),
ev->code,
diff --git a/tools/mouse-dpi-tool.c b/tools/mouse-dpi-tool.c
index b472ad0..da44124 100644
--- a/tools/mouse-dpi-tool.c
+++ b/tools/mouse-dpi-tool.c
@@ -61,12 +61,6 @@ usage(void) {
return 1;
}
-static inline uint64_t
-tv2us(const struct timeval *tv)
-{
- return tv->tv_sec * 1000000 + tv->tv_usec;
-}
-
static inline double
get_frequency(uint64_t last, uint64_t current)
{
@@ -119,7 +113,7 @@ handle_event(struct measurements *m, const struct input_event *ev)
const int idle_reset = 3000000; /* us */
uint64_t last_us = m->us;
- m->us = tv2us(&ev->time);
+ m->us = ev->input_event_sec * 1000000 + ev->input_event_usec;
/* reset after pause */
if (last_us + idle_reset < m->us) {