From 22608bd203a7867df4d706a23e598d89c8b3a2bd Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sun, 25 Jan 2009 21:40:04 +0000 Subject: [PATCH] give error when no TAP adapters found, and clean better --- Makefile | 2 +- src/tun.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9aeb23e..01c2325 100644 --- a/Makefile +++ b/Makefile @@ -58,5 +58,5 @@ clean: @echo "Cleaning..." @(cd src; $(MAKE) clean) @(cd tests; $(MAKE) clean) - @rm -rf bin + @rm -rf bin iodine-latest-win32* diff --git a/src/tun.c b/src/tun.c index 86f8a89..eb3e4e2 100644 --- a/src/tun.c +++ b/src/tun.c @@ -264,8 +264,10 @@ open_tun(const char *tun_device) memset(adapter, 0, sizeof(adapter)); get_device(adapter, sizeof(adapter)); - if (strlen(adapter) == 0) + if (strlen(adapter) == 0) { + warnx("No TAP adapters found. See README-win32.txt for help.\n"); return -1; + } snprintf(tapfile, sizeof(tapfile), "%s%s.tap", TAP_DEVICE_SPACE, adapter); printf("Opening device %s\n", tapfile);