aboutsummaryrefslogtreecommitdiffstats
path: root/community/ostree/musl-fixes.patch
blob: 69eea3efb84401fdff1a8c5c552761adeb8c54f9 (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
--- a/config.h.in
+++ b/config.h.in
@@ -148,3 +148,15 @@
 
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
+
+/* 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
+
+
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
@@ -28,6 +28,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
@@ -35,6 +35,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
@@ -28,6 +28,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)
 {