From 4cab313b8cd08b36bf620600eeec2e4bdedacde7 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 4 Oct 2015 22:33:27 +0200 Subject: [PATCH] Fix compiler warnings --- cpu/native/net/linuxradio-drv.c | 1 + cpu/native/net/tapdev.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cpu/native/net/linuxradio-drv.c b/cpu/native/net/linuxradio-drv.c index e9760d604..a2be32940 100644 --- a/cpu/native/net/linuxradio-drv.c +++ b/cpu/native/net/linuxradio-drv.c @@ -43,6 +43,7 @@ #include "net/packetbuf.h" #include "net/netstack.h" +#include #include #include #include diff --git a/cpu/native/net/tapdev.c b/cpu/native/net/tapdev.c index e58b3c475..b60cd1946 100644 --- a/cpu/native/net/tapdev.c +++ b/cpu/native/net/tapdev.c @@ -93,8 +93,11 @@ static void remove_route(void) { char buf[1024]; + int ret; + snprintf(buf, sizeof(buf), "route delete -net 172.18.0.0"); - system(buf); + ret = system(buf); + fprintf(stderr, "ret %d\n", ret); fprintf(stderr, "%s\n", buf); } @@ -103,7 +106,8 @@ void tapdev_init(void) { char buf[1024]; - + int ret; + fd = open(DEVTAP, O_RDWR); if(fd == -1) { perror("tapdev: tapdev_init: open"); @@ -123,7 +127,8 @@ tapdev_init(void) #endif /* Linux */ snprintf(buf, sizeof(buf), "ifconfig tap0 inet 172.18.0.1/16"); - system(buf); + ret = system(buf); + fprintf(stderr, "ret %d\n", ret); fprintf(stderr, "%s\n", buf); #ifdef linux /* route add for linux */ @@ -132,8 +137,9 @@ tapdev_init(void) /* route add for freebsd */ snprintf(buf, sizeof(buf), "route add -net 172.18.0.0/16 -iface tap0"); #endif /* linux */ - - system(buf); + + ret = system(buf); + fprintf(stderr, "ret %d\n", ret); fprintf(stderr, "%s\n", buf); atexit(remove_route);