app-emulation/cri-o: add Fix-pinns-compilation-for-TEMP_FAILURE_RETRY.patch

This commit is contained in:
Alexander Miroshnichenko 2021-01-26 12:38:03 +03:00
parent 63572f1b3c
commit a196d34c37
No known key found for this signature in database
GPG Key ID: E93720C6C73A77F4
2 changed files with 43 additions and 0 deletions

View File

@ -38,6 +38,10 @@ DEPEND="
RDEPEND="${COMMON_DEPEND}
!<app-emulation/libpod-1.3.2-r1"
PATCHES=(
"${FILESDIR}"/0001-Fix-pinns-compilation-for-TEMP_FAILURE_RETRY.patch
)
src_prepare() {
default

View File

@ -0,0 +1,39 @@
From c59fd827138efb66226811fb312be41ef1a15e3c Mon Sep 17 00:00:00 2001
From: Alexander Miroshnichenko <alex@millerson.name>
Date: Tue, 26 Jan 2021 12:34:11 +0300
Subject: [PATCH] Fix pinns compilation for TEMP_FAILURE_RETRY
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
In case the macro is not available we now define it on our own in the utils.
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
pinns/src/utils.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/pinns/src/utils.h b/pinns/src/utils.h
index 2bb0479c05cf..c213320bfd4d 100644
--- a/pinns/src/utils.h
+++ b/pinns/src/utils.h
@@ -11,6 +11,17 @@
#include <syslog.h>
#include <unistd.h>
+#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 _pexit(s) \
do { \
fprintf(stderr, "[pinns:e]: %s: %s\n", s, strerror(errno)); \
--
2.26.2