All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
@ 2019-01-28  9:32 Nicolas Serafini
  2019-01-28 12:34 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Serafini @ 2019-01-28  9:32 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

TEMP_FAILURE_RETRY is not available on musl.

Signed-off-by: Nicolas Serafini <nicolas.serafini@sensefly.com>
---
 drivers/mbimmodem/mbim.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mbimmodem/mbim.c b/drivers/mbimmodem/mbim.c
index 54b18acf..4b040528 100644
--- a/drivers/mbimmodem/mbim.c
+++ b/drivers/mbimmodem/mbim.c
@@ -37,6 +37,16 @@
 #include "mbim-message.h"
 #include "mbim-private.h"
 
+/* taken from glibc unistd.h for musl support */
+#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
+
 #define MAX_CONTROL_TRANSFER 4096
 #define HEADER_SIZE (sizeof(struct mbim_message_header) + \
 					sizeof(struct mbim_fragment_header))
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-28 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-28  9:32 [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile) Nicolas Serafini
2019-01-28 12:34 ` Marcel Holtmann
2019-01-28 15:19   ` Nicolas Serafini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.