aboutsummaryrefslogtreecommitdiffstats
path: root/community/ostree/musl-fixes.patch
blob: a0cb0e5ed83eb7be920f218ab72cb15a6597ca12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
--- a/config.h.in
+++ b/config.h.in
@@ -223,6 +223,18 @@
 #ifndef _POSIX_SOURCE
 # undef _POSIX_SOURCE
 #endif
+
+/* taken from glibc unistd.h and fixes musl */
+#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 to 2 if needed for POSIX-compatible behavior.  */
 #ifndef _POSIX_1_SOURCE
 # undef _POSIX_1_SOURCE
diff --git a/libglnx/glnx-dirfd.h b/libglnx/glnx-dirfd.h
index 0046ac8..79b9f6a 100644
--- a/libglnx/glnx-dirfd.h
+++ b/libglnx/glnx-dirfd.h
@@ -29,6 +29,16 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+/* taken from glibc unistd.h and fixes musl */
+#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
+
 G_BEGIN_DECLS
  
 /**

diff --git a/libglnx/glnx-fdio.h b/libglnx/glnx-fdio.h
index c0a7cc1..8f72920 100644
--- a/libglnx/glnx-fdio.h
+++ b/libglnx/glnx-fdio.h
@@ -36,6 +36,17 @@
 #include <glnx-macros.h>
 #include <glnx-errors.h>
 
+/* taken from glibc unistd.h and fixes musl */
+#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
+
+
 G_BEGIN_DECLS
 
 /* Irritatingly, g_basename() which is what we want

diff --git a/libglnx/glnx-xattrs.c b/libglnx/glnx-xattrs.c
index 79a14cd..ebb96d4 100644
--- a/libglnx/glnx-xattrs.c
+++ b/libglnx/glnx-xattrs.c
@@ -29,6 +29,16 @@
 #include <glnx-errors.h>
 #include <glnx-local-alloc.h>
 
+/* taken from glibc unistd.h and fixes musl */
+#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
+
 static GVariant *
 variant_new_ay_bytes (GBytes *bytes)
 {