mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-21 18:25:41 +03:00
54 lines
1.8 KiB
Diff
54 lines
1.8 KiB
Diff
Has been merged upstream already. https://git.sailfishos.org/mer-core/usb-moded/merge_requests/57
|
|
|
|
From 6d19366c5c9fff70c0337e1288b33c6834e3374c Mon Sep 17 00:00:00 2001
|
|
From: Bart Ribbers <bribbers@disroot.org>
|
|
Date: Wed, 25 Mar 2020 12:48:55 +0100
|
|
Subject: [PATCH] Define TEMP_FAILURE_RETRY on non-glibc systems
|
|
|
|
This makes it work for example on Musl systems
|
|
---
|
|
src/usb_moded-modesetting.h | 10 ++++++++++
|
|
src/usb_moded-sigpipe.h | 10 ++++++++++
|
|
2 files changed, 20 insertions(+)
|
|
|
|
diff --git a/src/usb_moded-modesetting.h b/src/usb_moded-modesetting.h
|
|
index 95e345a..92cceab 100644
|
|
--- a/src/usb_moded-modesetting.h
|
|
+++ b/src/usb_moded-modesetting.h
|
|
@@ -57,4 +57,14 @@ void modesetting_quit (void);
|
|
# define write_to_file(path,text)\
|
|
modesetting_write_to_file_real(__FILE__,__LINE__,__FUNCTION__,(path),(text))
|
|
|
|
+/* Used to retry syscalls that can return EINTR. Taken from bionic unistd.h */
|
|
+#ifndef TEMP_FAILURE_RETRY
|
|
+#define TEMP_FAILURE_RETRY(exp) ({ \
|
|
+ __typeof__(exp) _rc; \
|
|
+ do { \
|
|
+ _rc = (exp); \
|
|
+ } while (_rc == -1 && errno == EINTR); \
|
|
+ _rc; })
|
|
+#endif
|
|
+
|
|
#endif /* USB_MODED_MODESETTING_H_ */
|
|
diff --git a/src/usb_moded-sigpipe.h b/src/usb_moded-sigpipe.h
|
|
index 095863d..fcea271 100644
|
|
--- a/src/usb_moded-sigpipe.h
|
|
+++ b/src/usb_moded-sigpipe.h
|
|
@@ -37,4 +37,14 @@
|
|
|
|
bool sigpipe_init(void);
|
|
|
|
+/* Used to retry syscalls that can return EINTR. Taken from Bionic unistd.h */
|
|
+#ifndef TEMP_FAILURE_RETRY
|
|
+#define TEMP_FAILURE_RETRY(exp) ({ \
|
|
+ __typeof__(exp) _rc; \
|
|
+ do { \
|
|
+ _rc = (exp); \
|
|
+ } while (_rc == -1 && errno == EINTR); \
|
|
+ _rc; })
|
|
+#endif
|
|
+
|
|
#endif /* USB_MODED_SIGPIPE_H_ */
|
|
--
|
|
2.23.0
|
|
|