summaryrefslogtreecommitdiff
path: root/user/qemu/time64.patch
blob: 342231146ab091e04b02d1faea285d49101eddc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- qemu-3.0.0/hw/input/virtio-input-host.c.old	2018-08-14 19:10:34.000000000 +0000
+++ qemu-3.0.0/hw/input/virtio-input-host.c	2020-01-24 06:12:08.788062930 +0000
@@ -193,13 +193,16 @@
 {
     VirtIOInputHost *vih = VIRTIO_INPUT_HOST(vinput);
     struct input_event evdev;
+    struct timeval tv;
     int rc;
 
-    if (gettimeofday(&evdev.time, NULL)) {
+    if (gettimeofday(&tv, NULL)) {
         perror("virtio_input_host_handle_status: gettimeofday");
         return;
     }
 
+    evdev.input_event_sec = tv.tv_sec;
+    evdev.input_event_usec = tv.tv_usec;
     evdev.type = le16_to_cpu(event->type);
     evdev.code = le16_to_cpu(event->code);
     evdev.value = le32_to_cpu(event->value);
--- qemu-4.2.0/contrib/vhost-user-input/main.c.old	2019-12-12 18:20:47.000000000 +0000
+++ qemu-4.2.0/contrib/vhost-user-input/main.c	2020-06-15 04:46:15.198762807 +0000
@@ -115,13 +115,16 @@
 static void vi_handle_status(VuInput *vi, virtio_input_event *event)
 {
     struct input_event evdev;
+    struct timeval tv;
     int rc;
 
-    if (gettimeofday(&evdev.time, NULL)) {
+    if (gettimeofday(&tv, NULL)) {
         perror("vi_handle_status: gettimeofday");
         return;
     }
 
+    evdev.input_event_sec = tv.tv_sec;
+    evdev.input_event_usec = tv.tv_usec;
     evdev.type = le16toh(event->type);
     evdev.code = le16toh(event->code);
     evdev.value = le32toh(event->value);