aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ofono/fix-TEMP_FAILURE_RETRY.patch
blob: 70df8c970262a0fdc76d087f08a09bfc01625409 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/drivers/mbimmodem/mbim.c b/drivers/mbimmodem/mbim.c
index 54b18ac..5f924ca 100644
--- a/drivers/mbimmodem/mbim.c
+++ b/drivers/mbimmodem/mbim.c
@@ -41,6 +41,15 @@
 #define HEADER_SIZE (sizeof(struct mbim_message_header) + \
 					sizeof(struct mbim_fragment_header))
 
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+  (__extension__                                                              \
+    ({ long int __result;                                                     \
+       do __result = (long int) (expression);                                 \
+       while (__result == -1L && errno == EINTR);                             \
+       __result; }))
+#endif
+
 const uint8_t mbim_uuid_basic_connect[] = {
 	0xa2, 0x89, 0xcc, 0x33, 0xbc, 0xbb, 0x8b, 0x4f, 0xb6, 0xb0,
 	0x13, 0x3e, 0xc2, 0xaa, 0xe6, 0xdf