All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] ir-ctl: use strndup instead of strndupa (fixes musl compile)
@ 2017-02-20 20:33 Peter Seiderer
  2017-02-20 20:33 ` [PATCH v1 2/2] ir-ctl: add optional copy of TEMP_FAILURE_RETRY macro (fix " Peter Seiderer
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Seiderer @ 2017-02-20 20:33 UTC (permalink / raw)
  To: linux-media

Fixes buildroot musl compile (see [1], [2]):

  ir-ctl.c:(.text+0xb06): undefined reference to `strndupa'

[1] http://autobuild.buildroot.net/results/b8b96c7bbf2147dacac62485cbfdbcfd758271a5
[2] http://lists.busybox.net/pipermail/buildroot/2017-February/184048.html

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 utils/ir-ctl/ir-ctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index bc58cee0..f938b429 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -344,12 +344,14 @@ static struct file *read_scancode(const char *name)
 		return NULL;
 	}
 
-	pstr = strndupa(name, p - name);
+	pstr = strndup(name, p - name);
 
 	if (!protocol_match(pstr, &proto)) {
 		fprintf(stderr, _("error: protocol '%s' not found\n"), pstr);
+		free(pstr);
 		return NULL;
 	}
+	free(pstr);
 
 	if (!strtoscancode(p + 1, &scancode)) {
 		fprintf(stderr, _("error: invalid scancode '%s'\n"), p + 1);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v1 2/2] ir-ctl: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
  2017-02-20 20:33 [PATCH v1 1/2] ir-ctl: use strndup instead of strndupa (fixes musl compile) Peter Seiderer
@ 2017-02-20 20:33 ` Peter Seiderer
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Seiderer @ 2017-02-20 20:33 UTC (permalink / raw)
  To: linux-media

Fixes buildroot musl compile (see [1], [2]):

  ir-ctl.c:(.text+0xe01): undefined reference to `TEMP_FAILURE_RETRY'

[1] http://autobuild.buildroot.net/results/b8b96c7bbf2147dacac62485cbfdbcfd758271a5
[2] http://lists.busybox.net/pipermail/buildroot/2017-February/184048.html

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 utils/ir-ctl/ir-ctl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index f938b429..e9da7778 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -44,6 +44,15 @@
 
 # define N_(string) string
 
+/* taken from glibc 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
 
 /* See drivers/media/rc/ir-lirc-codec.c line 23 */
 #define LIRCBUF_SIZE	512
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-20 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 20:33 [PATCH v1 1/2] ir-ctl: use strndup instead of strndupa (fixes musl compile) Peter Seiderer
2017-02-20 20:33 ` [PATCH v1 2/2] ir-ctl: add optional copy of TEMP_FAILURE_RETRY macro (fix " Peter Seiderer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.