summarylogtreecommitdiffstats
path: root/fix-build.patch
blob: 4df308e773c112a3f334115585aa25ed0f1241bf (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
diff --git a/event-input.c b/event-input.c
index 9d9d4c7..16a3e09 100644
--- a/event-input.c
+++ b/event-input.c
@@ -1908,7 +1908,7 @@ evin_iomon_generate_activity(struct input_event *ev, bool cooked, bool raw)
     if( !ev )
         goto EXIT;
 
-    time_t t = ev->time.tv_sec;
+    time_t t = ev->input_event_sec;
 
     /* Actual, never synthetized user activity */
     if( raw ) {
diff --git a/libwakelock.h b/libwakelock.h
index d87f4cd..ec4be44 100644
--- a/libwakelock.h
+++ b/libwakelock.h
@@ -7,6 +7,8 @@
 #ifndef LIBWAKELOCK_H_
 # define LIBWAKELOCK_H_
 
+#include "musl-compatibility.h"
+
 # ifdef __cplusplus
 extern "C" {
 # elif 0
diff --git a/mce-hybris.c b/mce-hybris.c
index 10f9117..3aafb91 100644
--- a/mce-hybris.c
+++ b/mce-hybris.c
@@ -328,7 +328,11 @@ static void *mce_hybris_lookup_function(const char *name)
     else if( access(path, F_OK) == -1 && errno == ENOENT ) {
       mce_log(LL_NOTICE, "%s: not installed", path);
     }
+#if defined(RTLD_DEEPBIND)
     else if( !(base = dlopen(path, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND)) ) {
+#else
+    else if( !(base = dlopen(path, RTLD_NOW|RTLD_LOCAL)) ) {
+#endif
       mce_log(LL_WARN, "%s: failed to load: %s", path, dlerror());
     }
     else {
diff --git a/mce.h b/mce.h
index b113d06..1a98555 100644
--- a/mce.h
+++ b/mce.h
@@ -26,6 +26,7 @@
 #ifndef _MCE_H_
 #define _MCE_H_
 
+#include "musl-compatibility.h"
 #include "datapipe.h"
 
 /** Indicate enabled (sub)mode */
diff --git a/multitouch.c b/multitouch.c
index 0e6fe41..93aa15d 100644
--- a/multitouch.c
+++ b/multitouch.c
@@ -431,7 +431,8 @@ mt_state_handle_event_b(mt_state_t *self, const struct input_event *ev)
 void
 mt_state_handle_event(mt_state_t *self, const struct input_event *ev)
 {
-    self->mts_event_time = ev->time;
+    self->mts_event_time.tv_sec = ev->input_event_sec;
+    self->mts_event_time.tv_usec = ev->input_event_usec;
 
     self->mts_event_handler_cb(self, ev);
 
diff --git a/musl-compatibility.h b/musl-compatibility.h
new file mode 100644
index 0000000..56cff68
--- /dev/null
+++ b/musl-compatibility.h
@@ -0,0 +1,10 @@
+/* Used to retry syscalls that can return EINTR. Taken from bionic unistd.h */
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(exp) ({         \
+    __typeof__(exp) _rc;                   \
+    do {                                   \
+        _rc = (exp);                       \
+    } while (_rc == -1 && errno == EINTR); \
+    _rc; })
+#endif
+
diff --git a/tools/evdev_trace.c b/tools/evdev_trace.c
index 8cac5b8..b4f944b 100644
--- a/tools/evdev_trace.c
+++ b/tools/evdev_trace.c
@@ -88,8 +88,8 @@ process_events(int fd, const char *title)
     if( emit_event_time )
     {
       snprintf(toe, sizeof toe, "%ld.%03ld - ",
-               (long)e->time.tv_sec,
-               (long)e->time.tv_usec / 1000);
+               (long)e->input_event_sec,
+               (long)e->input_event_usec / 1000);
     }
 
     printf("%s: %s%s0x%02x/%s - 0x%03x/%s - %d\n",