v4l-utils: fix musl

This commit is contained in:
Michael Gehring 2017-01-25 17:30:38 +00:00
parent 257b7c76c9
commit 0fe4df9a19

View file

@ -0,0 +1,27 @@
--- utils/ir-ctl/ir-ctl.c.orig 2017-01-25 17:27:44.373665101 +0000
+++ utils/ir-ctl/ir-ctl.c 2017-01-25 17:27:51.052665445 +0000
@@ -44,6 +44,24 @@
# define N_(string) string
+#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
+
+#ifndef strndupa
+#define strndupa(s, n) \
+ (__extension__ ({const char *__in = (s); \
+ size_t __len = strnlen (__in, (n)) + 1; \
+ char *__out = (char *) alloca (__len); \
+ __out[__len-1] = '\0'; \
+ (char *) memcpy (__out, __in, __len-1);}))
+#endif
+
/* See drivers/media/rc/ir-lirc-codec.c line 23 */
#define LIRCBUF_SIZE 512