1From a7bb1b5b26caa4b3c374c3d3f74f0dfe522d854f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 14:01:12 -0700
4Subject: [PATCH] chromium: musl: sandbox: Define TEMP_FAILURE_RETRY if not
5 defined
6
7Musl does not define this Macro
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Upstream-Status: Pending
11---
12 chromium/sandbox/linux/suid/sandbox.c | 9 +++++++++
13 1 file changed, 9 insertions(+)
14
15diff --git a/chromium/sandbox/linux/suid/sandbox.c b/chromium/sandbox/linux/suid/sandbox.c
16index 5fdb4817af8..e5b9431daa0 100644
17--- a/chromium/sandbox/linux/suid/sandbox.c
18+++ b/chromium/sandbox/linux/suid/sandbox.c
19@@ -46,6 +46,15 @@ static bool DropRoot();
20
21 #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
22
23+#ifndef TEMP_FAILURE_RETRY
24+# define TEMP_FAILURE_RETRY(expression) \
25+	(__extension__			\
26+	 ({ long int __result;		\
27+	  do __result = (long int) (expression); \
28+	  while (__result == -1L && errno == EINTR); \
29+	  __result; }))
30+#endif
31+
32 static void FatalError(const char* msg, ...)
33     __attribute__((noreturn, format(printf, 1, 2)));
34
35