aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-08 19:46:05 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-08 22:38:34 +0200
commit4502f4f2b7e49b0a6ac982000d0ab573e1768bbc (patch)
tree1011e284deeaa34428c6b99195fccccd1d578508 /src
parentwg-quick: android: support excluding applications (diff)
downloadwireguard-tools-4502f4f2b7e49b0a6ac982000d0ab573e1768bbc.tar.xz
wireguard-tools-4502f4f2b7e49b0a6ac982000d0ab573e1768bbc.zip
wg: only error on wg show if all interfaces fail
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/show.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/show.c b/src/show.c
index 415489b..b7f665c 100644
--- a/src/show.c
+++ b/src/show.c
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include <time.h>
#include <netdb.h>
@@ -394,12 +395,13 @@ int show_main(int argc, char *argv[])
perror("Unable to list interfaces");
return 1;
}
+ ret = !!*interfaces;
interface = interfaces;
for (size_t len = 0; (len = strlen(interface)); interface += len + 1) {
struct wgdevice *device = NULL;
if (ipc_get_device(&device, interface) < 0) {
- perror("Unable to access interface");
+ fprintf(stderr, "Unable to access interface %s: %s\n", interface, strerror(errno));
continue;
}
if (argc == 3) {
@@ -414,6 +416,7 @@ int show_main(int argc, char *argv[])
printf("\n");
}
free_wgdevice(device);
+ ret = 0;
}
free(interfaces);
} else if (!strcmp(argv[1], "interfaces")) {