summaryrefslogtreecommitdiffstats
path: root/tools/iproxy.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-09-21 02:39:29 +0200
committerGravatar Nikias Bassen2014-09-21 02:39:29 +0200
commitca68e3c287a8410fbef5280948a6d1d2255e0a89 (patch)
tree39ef1cb6002e035c56fb7726d8badc0a49f619c7 /tools/iproxy.c
parentb9a9f44f0250180fe89d4d22f635c17d7d9ea92e (diff)
downloadlibusbmuxd-ca68e3c287a8410fbef5280948a6d1d2255e0a89.tar.gz
libusbmuxd-ca68e3c287a8410fbef5280948a6d1d2255e0a89.tar.bz2
iproxy: Disconnect client if no or unmatching device is connected
Diffstat (limited to 'tools/iproxy.c')
-rw-r--r--tools/iproxy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/iproxy.c b/tools/iproxy.c
index 9099917..8d64784 100644
--- a/tools/iproxy.c
+++ b/tools/iproxy.c
@@ -201,8 +201,11 @@ static void *acceptor_thread(void *arg)
}
if (dev == NULL || dev->handle == 0) {
- printf("No connected/matching device found, terminating.\n");
+ printf("No connected/matching device found, disconnecting client.\n");
free(dev_list);
+ if (cdata->fd > 0) {
+ close(cdata->fd);
+ }
return NULL;
}