summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-07-22 02:29:08 -0600
committerAriadne Conill <ariadne@dereferenced.org>2020-07-22 02:29:08 -0600
commit073b1b40bde9935928758c3452176c0d8dc67370 (patch)
treebc47b75798216ac28f628fa73a6bc311f17b24bf
parenta4e5f74b589441077678d5d1546f7de0365a4627 (diff)
eventcomm: use 64-bit time safe accessors instead of timeval directly
when building on a 32-bit host with 64-bit time_t, using the input_event and input_event_usec accessors are necessary to deal with translation.
-rw-r--r--src/eventcomm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 3d0c5b0..6862539 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -575,9 +575,12 @@ SynapticsReadEvent(InputInfoPtr pInfo, struct input_event *ev)
ev->type = EV_SYN;
ev->code = SYN_REPORT;
ev->value = 0;
- ev->time = last_event_time;
- } else if (ev->type == EV_SYN)
- last_event_time = ev->time;
+ ev->input_event_sec = last_event_time.tv_sec;
+ ev->input_event_usec = last_event_time.tv_usec;
+ } else if (ev->type == EV_SYN) {
+ last_event_time.tv_sec = ev->input_event_sec;
+ last_event_time.tv_usec = ev->input_event_usec;
+ }
return TRUE;
}
@@ -725,7 +728,7 @@ EventReadHwState(InputInfoPtr pInfo,
case SYN_REPORT:
hw->numFingers = count_fingers(pInfo, comm);
if (proto_data->have_monotonic_clock)
- hw->millis = 1000 * ev.time.tv_sec + ev.time.tv_usec / 1000;
+ hw->millis = 1000 * ev.input_event_sec + ev.input_event_usec / 1000;
else
hw->millis = GetTimeInMillis();
SynapticsCopyHwState(hwRet, hw);