44 lines
1.7 KiB
Diff
44 lines
1.7 KiB
Diff
Source: @pullmoll
|
|
Upstream: no
|
|
Reason: Gracefully handle transition to 64 bit time with musl-1.2.1
|
|
|
|
--- hw/dmx/input/usb-keyboard.c 2020-12-01 17:32:25.000000000 +0100
|
|
+++ hw/dmx/input/usb-keyboard.c 2020-12-01 20:28:02.489695853 +0100
|
|
@@ -278,8 +278,8 @@
|
|
|
|
gettimeofday(&tv, NULL);
|
|
for (i = 0; i < 5; i++) {
|
|
- event.time.tv_sec = tv.tv_sec;
|
|
- event.time.tv_usec = tv.tv_usec;
|
|
+ event.input_event_sec = tv.tv_sec;
|
|
+ event.input_event_usec = tv.tv_usec;
|
|
event.type = EV_LED;
|
|
if (i == 0)
|
|
led = 1; /* LED_CAPSL == 0x01 */
|
|
--- hw/dmx/examples/ev.c 2020-12-01 17:32:25.000000000 +0100
|
|
+++ hw/dmx/examples/ev.c 2020-12-01 20:31:24.585605950 +0100
|
|
@@ -114,8 +114,8 @@
|
|
if ((fd = open(name, O_RDWR, 0)) >= 0) {
|
|
printf("%s: open, fd = %d\n", name, fd);
|
|
for (i = 0; i < LED_MAX; i++) {
|
|
- event.time.tv_sec = time(0);
|
|
- event.time.tv_usec = 0;
|
|
+ event.input_event_sec = time(0);
|
|
+ event.input_event_usec = 0;
|
|
event.type = EV_LED;
|
|
event.code = i;
|
|
event.value = 0;
|
|
@@ -123,9 +123,10 @@
|
|
}
|
|
|
|
while ((rc = read(fd, &event, sizeof(event))) > 0) {
|
|
+ struct timeval t = {event.input_event_sec, event.input_event_usec};
|
|
printf("%-24.24s.%06lu type 0x%04x; code 0x%04x;"
|
|
" value 0x%08x; ",
|
|
- ctime(&event.time.tv_sec),
|
|
- event.time.tv_usec, event.type, event.code, event.value);
|
|
+ ctime(&t.tv_sec),
|
|
+ t.tv_usec, event.type, event.code, event.value);
|
|
switch (event.type) {
|
|
case EV_KEY:
|