Fixes build on musl which does not provide this macro

Signed-off-by: Khem Raj <[email protected]>
---
 drivers/mbimmodem/mbim-private.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mbimmodem/mbim-private.h b/drivers/mbimmodem/mbim-private.h
index e159235..51693ea 100644
--- a/drivers/mbimmodem/mbim-private.h
+++ b/drivers/mbimmodem/mbim-private.h
@@ -21,6 +21,15 @@
 
 #define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1))
 
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) ({     \
+  __typeof(expression) __result;              \
+  do {                                        \
+    __result = (expression);                  \
+  } while (__result == -1 && errno == EINTR); \
+  __result; })
+#endif
+
 enum mbim_control_message {
        MBIM_OPEN_MSG = 0x1,
        MBIM_CLOSE_MSG = 0x2,
-- 
2.21.0

_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to