aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-base/xorg-server/files/xorg-server-1.20.11-fix-musl-input_event.patch')
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.20.11-fix-musl-input_event.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/x11-base/xorg-server/files/xorg-server-1.20.11-fix-musl-input_event.patch b/x11-base/xorg-server/files/xorg-server-1.20.11-fix-musl-input_event.patch
new file mode 100644
index 00000000..cd79b67d
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.20.11-fix-musl-input_event.patch
@@ -0,0 +1,58 @@
+From d8f70ec853fcd43199ca4887f75acc8a544084ce Mon Sep 17 00:00:00 2001
+From:
+Date: Fri, 30 Apr 2021 22:53:16 -0500
+Subject: [PATCH 3/4] Gracefully handle transition to 64 bit time with
+ musl-1.2.1
+
+---
+ hw/dmx/examples/ev.c | 9 +++++----
+ hw/dmx/input/usb-keyboard.c | 4 ++--
+ 2 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/hw/dmx/examples/ev.c b/hw/dmx/examples/ev.c
+index 09e703c..692c2ef 100644
+--- a/hw/dmx/examples/ev.c
++++ b/hw/dmx/examples/ev.c
+@@ -114,8 +114,8 @@ main(int argc, char **argv)
+ 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,10 +123,11 @@ main(int argc, char **argv)
+ }
+
+ 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:
+ if (event.code > BTN_MISC) {
+diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c
+index b26c822..feac3d2 100644
+--- a/hw/dmx/input/usb-keyboard.c
++++ b/hw/dmx/input/usb-keyboard.c
+@@ -278,8 +278,8 @@ kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
+
+ 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 */
+--
+2.26.3
+