[PATCH] demo/posix/cobalt: Avoid ancillaries header

Jan Kiszka jan.kiszka at siemens.com
Mon Sep 28 19:16:17 CEST 2020


From: Jan Kiszka <jan.kiszka at siemens.com>

Makes the demo more portable.

Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
---
 demo/posix/cobalt/eth_p_all.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/demo/posix/cobalt/eth_p_all.c b/demo/posix/cobalt/eth_p_all.c
index 91aef9fbdb..c4cf0d696f 100644
--- a/demo/posix/cobalt/eth_p_all.c
+++ b/demo/posix/cobalt/eth_p_all.c
@@ -40,7 +40,6 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/ether.h>
-#include <boilerplate/ancillaries.h>
 
 char buffer[10*1024];
 int sock;
@@ -73,7 +72,7 @@ int main(int argc, char *argv[])
 	if (argc > 1) {
 		struct ifreq ifr;
 
-		namecpy(ifr.ifr_name, argv[1]);
+		snprintf(ifr.ifr_name, IFNAMSIZ, "%s", argv[1]);
 		if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) {
 			perror("cannot get interface index");
 			close(sock);
-- 
2.26.2



More information about the Xenomai mailing list