Skip to contentSkip to conversation

ell: fix build with musl libc

PATCH Applied [email protected] 2 participants 2 messages Apr 5, 2018 – Apr 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ell: fix build with musl libc

From: "Maxin B. John" <[email protected]>

musl libc doesn't implement TEMP_FAILURE_RETRY. Use the TEMP_FAILURE_RETRY from glibc to fix build.

---
 ell/dbus.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
ell/dbus.h +10 -0
index a7c08d2..3ff5e0f 100644
@@ -28,6 +28,16 @@
 #include <stddef.h>
 #include <stdarg.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
+
 #ifdef __cplusplus
 extern "C" {
 #endif
Signature · 1 line
2.4.0
#1 lore raw

Hi Maxin,

Quoted 8 lines · maxin.john(a)gmail.com

From: "Maxin B. John" <[email protected]>

musl libc doesn't implement TEMP_FAILURE_RETRY. Use the TEMP_FAILURE_RETRY from glibc to fix build.

---
  ell/dbus.h | 10 ++++++++++
  1 file changed, 10 insertions(+)

Applied, thanks.

Regards,
-Denis