diff mbox series

[v1,1/1] package/brltty: fix input_event related compile failure

Message ID 20200607181116.29433-1-heiko.thiery@gmail.com
State Accepted
Headers show
Series [v1,1/1] package/brltty: fix input_event related compile failure | expand

Commit Message

Heiko Thiery June 7, 2020, 6:11 p.m. UTC
Add a patch to fix input_event time related compile failure. The problem
is reported and fixed upstream.

Fixes:
http://autobuild.buildroot.net/results/7c5278c0ff2b2d8f88803e256803b31a75904efe/build-end.log

./system_linux.c: In function 'writeInputEvent':
./system_linux.c:962:23: error: 'struct input_event' has no member named 'time'; did you mean 'type'?
   gettimeofday(&event.time, NULL);
                       ^~~~
                       type

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 ...nput_event-time-related-compile-fail.patch | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 package/brltty/0002-fix-input_event-time-related-compile-fail.patch

Comments

Thomas Petazzoni June 10, 2020, 9:25 p.m. UTC | #1
On Sun,  7 Jun 2020 20:11:17 +0200
Heiko Thiery <heiko.thiery@gmail.com> wrote:

> Add a patch to fix input_event time related compile failure. The problem
> is reported and fixed upstream.
> 
> Fixes:
> http://autobuild.buildroot.net/results/7c5278c0ff2b2d8f88803e256803b31a75904efe/build-end.log
> 
> ./system_linux.c: In function 'writeInputEvent':
> ./system_linux.c:962:23: error: 'struct input_event' has no member named 'time'; did you mean 'type'?
>    gettimeofday(&event.time, NULL);
>                        ^~~~
>                        type
> 
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
>  ...nput_event-time-related-compile-fail.patch | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 package/brltty/0002-fix-input_event-time-related-compile-fail.patch

Applied to master, thanks. If not already done, please submit the patch
upstream. Thanks!

Thomas
Peter Korsgaard July 12, 2020, 9:44 p.m. UTC | #2
>>>>> "Heiko" == Heiko Thiery <heiko.thiery@gmail.com> writes:

 > Add a patch to fix input_event time related compile failure. The problem
 > is reported and fixed upstream.

 > Fixes:
 > http://autobuild.buildroot.net/results/7c5278c0ff2b2d8f88803e256803b31a75904efe/build-end.log

 > ./system_linux.c: In function 'writeInputEvent':
 > ./system_linux.c:962:23: error: 'struct input_event' has no member named 'time'; did you mean 'type'?
 >    gettimeofday(&event.time, NULL);
 >                        ^~~~
 >                        type

 > Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

Committed to 2020.05.x, thanks.
diff mbox series

Patch

diff --git a/package/brltty/0002-fix-input_event-time-related-compile-fail.patch b/package/brltty/0002-fix-input_event-time-related-compile-fail.patch
new file mode 100644
index 0000000000..249d420ca9
--- /dev/null
+++ b/package/brltty/0002-fix-input_event-time-related-compile-fail.patch
@@ -0,0 +1,52 @@ 
+From 43390f9906a8c663872e0eab56c1173032d1bd6c Mon Sep 17 00:00:00 2001
+From: Heiko Thiery <heiko.thiery@gmail.com>
+Date: Sun, 7 Jun 2020 12:58:38 +0200
+Subject: [PATCH] fix input_event time related compile fail
+
+./system_linux.c: In function 'writeInputEvent':
+./system_linux.c:962:23: error: 'struct input_event' has no member named 'time'; did you mean 'type'?
+   gettimeofday(&event.time, NULL);
+                       ^~~~
+                       type
+
+Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
+---
+ Programs/system_linux.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Programs/system_linux.c b/Programs/system_linux.c
+index a97ee7ff6..77052d32f 100644
+--- a/Programs/system_linux.c
++++ b/Programs/system_linux.c
+@@ -40,6 +40,14 @@
+ #ifdef HAVE_LINUX_INPUT_H
+ #include <linux/input.h>
+ 
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#endif
++
++#ifndef input_event_usec
++#define input_event_usec time.tv_usec
++#endif
++
+ #include "kbd_keycodes.h"
+ 
+ LINUX_KEY_MAP(xt00) = {
+@@ -957,9 +965,12 @@ int
+ writeInputEvent (UinputObject *uinput, uint16_t type, uint16_t code, int32_t value) {
+ #ifdef HAVE_LINUX_UINPUT_H
+   struct input_event event;
++  struct timeval tv;
+ 
+   memset(&event, 0, sizeof(event));
+-  gettimeofday(&event.time, NULL);
++  gettimeofday(&tv, NULL);
++  event.input_event_sec = tv.tv_sec;
++  event.input_event_usec = tv.tv_usec;
+   event.type = type;
+   event.code = code;
+   event.value = value;
+-- 
+2.20.1
+