PATCH: v4l-utils/utils/ir-ctl/irc-ctl.c: fix musl build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.
This is my fist attempt to send a patch for v4l-utils project.
I maintain v4l-utils package for Alpine Linux (www.alpinelinux.org), a musl-based distro.

This patch allows the build for v4l-utils by allowing alternatives to GLIBC assumptions.

Thanks for considering.

--
:: Francesco ::
Twit.....http://twitter.com/fcolista
E-Mail...francesco@xxxxxxx
AboutMe..http://about.me/fcolista
GnuPG ID: C4FB9584
From 71f399cb1399c35ff4ce165c2cec0fcd3256d34e Mon Sep 17 00:00:00 2001
From: Francesco Colista <fcolista@xxxxxxxxxxxxx>
Date: Mon, 20 Feb 2017 10:16:01 +0100
Subject: [PATCH] utils/ir-ctl/ir-ctl.c: fix build with musl library

This patch allows to build correctly v4l-utils on musl-based distributions.
It provides alternative to glibc assumptions.
---
 utils/ir-ctl/ir-ctl.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index bc58cee0..0bd0ddcc 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -42,6 +42,20 @@
 # define _(string) string
 #endif
 
+#if !defined(__GLIBC__)
+
+/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
+   set to EINTR.  */
+
+# define TEMP_FAILURE_RETRY(expression) \
+  (__extension__                                                              \
+    ({ long int __result;                                                     \
+       do __result = (long int) (expression);                                 \
+       while (__result == -1L && errno == EINTR);                             \
+       __result; }))
+
+#endif
+
 # define N_(string) string
 
 
-- 
2.11.1


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux