blob: 8a5a300adc7ab62611be544e937144332ca1310a [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001From 22b52db4842611ac31a356f023fc09595384e2ad Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 23 May 2019 18:11:22 -0700
4Subject: [PATCH] mbim: add an optional TEMP_FAILURE_RETRY macro copy
5
6Fixes build on musl which does not provide this macro
7
8Upstream-Status: Submitted [https://lists.ofono.org/pipermail/ofono/2019-May/019370.html]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 drivers/mbimmodem/mbim-private.h | 9 +++++++++
12 1 file changed, 9 insertions(+)
13
14diff --git a/drivers/mbimmodem/mbim-private.h b/drivers/mbimmodem/mbim-private.h
15index e159235..51693ea 100644
16--- a/drivers/mbimmodem/mbim-private.h
17+++ b/drivers/mbimmodem/mbim-private.h
18@@ -21,6 +21,15 @@
19
20 #define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1))
21
22+#ifndef TEMP_FAILURE_RETRY
23+#define TEMP_FAILURE_RETRY(expression) ({ \
24+ __typeof(expression) __result; \
25+ do { \
26+ __result = (expression); \
27+ } while (__result == -1 && errno == EINTR); \
28+ __result; })
29+#endif
30+
31 enum mbim_control_message {
32 MBIM_OPEN_MSG = 0x1,
33 MBIM_CLOSE_MSG = 0x2,
34--
352.21.0
36