aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtwebengine/0003-chromium-musl-sandbox-Define-TEMP_FAILURE_RETRY-if-n.patch
blob: e808eb700f0e45b85150896018cf8e40f223e442 (plain)
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
From 5d7080bf2001a022223c4089a199605b5f9a5cce Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 7 Jul 2017 14:01:12 -0700
Subject: [PATCH] chromium: musl: sandbox: Define TEMP_FAILURE_RETRY if not
 defined

Musl does not define this Macro

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 chromium/sandbox/linux/suid/sandbox.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/chromium/sandbox/linux/suid/sandbox.c b/chromium/sandbox/linux/suid/sandbox.c
index 66f68ef..9284d0d 100644
--- a/chromium/sandbox/linux/suid/sandbox.c
+++ b/chromium/sandbox/linux/suid/sandbox.c
@@ -44,6 +44,15 @@ static bool DropRoot();
 
 #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
 
+#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 void FatalError(const char* msg, ...)
     __attribute__((noreturn, format(printf, 1, 2)));