blob: d8c044cb92242d74b7ace806fd256d1756903b55 [file] [log] [blame]
Brad Bishop0a921262019-09-24 07:40:45 -04001From 5a4f2ddb0a6c656b425a3caa41f5af766ed5f44b Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Mon, 9 Sep 2019 14:19:18 +0100
4Subject: [PATCH] macros: Add TEMP_FAILURE_RETRY for musl
5
6TEMP_FAILURE_RETRY is glibc specific, add a definition for musl.
7
8See https://github.com/ostreedev/ostree/issues/731
9
10Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
11Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
12Upstream-Status: Accepted [https://gitlab.gnome.org/GNOME/libglnx/commit/15c06468804014fc49f6f340132930703f919b19]
13---
14 glnx-macros.h | 10 ++++++++++
15 1 file changed, 10 insertions(+)
16
17diff --git a/libglnx.glnx-macros.h b/libglnx/glnx-macros.h
18index 6d8aca93f8a3..700fc75ceed0 100644
19--- a/libglnx.glnx-macros.h
20+++ b/libglnx/glnx-macros.h
21@@ -31,6 +31,16 @@ G_BEGIN_DECLS
22 /* All of these are for C only. */
23 #ifndef __GI_SCANNER__
24
25+/* fixes builds against musl, taken from glibc unistd.h */
26+#ifndef TEMP_FAILURE_RETRY
27+#define TEMP_FAILURE_RETRY(expression) \
28+ (__extension__ \
29+ ({ long int __result; \
30+ do __result = (long int) (expression); \
31+ while (__result == -1L && errno == EINTR); \
32+ __result; }))
33+#endif
34+
35 /* Taken from https://github.com/systemd/systemd/src/basic/string-util.h
36 * at revision v228-666-gcf6c8c4
37 */
38--
392.17.1
40