diff options
author | Nikias Bassen | 2014-09-26 01:17:17 +0200 |
---|---|---|
committer | Nikias Bassen | 2014-09-26 01:17:17 +0200 |
commit | 84fc9379083069dc4c107cca83f2cfe368785f15 (patch) | |
tree | bf1a3455253ce60cf88bc36e0286b0ed912ccf78 /tools | |
parent | ca68e3c287a8410fbef5280948a6d1d2255e0a89 (diff) | |
download | libusbmuxd-84fc9379083069dc4c107cca83f2cfe368785f15.tar.gz libusbmuxd-84fc9379083069dc4c107cca83f2cfe368785f15.tar.bz2 |
iproxy: Also disconnect client if usbmuxd is not running or no device is found
Diffstat (limited to 'tools')
-rw-r--r-- | tools/iproxy.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/iproxy.c b/tools/iproxy.c index 8d64784..bd9718c 100644 --- a/tools/iproxy.c +++ b/tools/iproxy.c @@ -176,6 +176,9 @@ static void *acceptor_thread(void *arg) if ((count = usbmuxd_get_device_list(&dev_list)) < 0) { printf("Connecting to usbmuxd failed, terminating.\n"); free(dev_list); + if (cdata->fd > 0) { + close(cdata->fd); + } return NULL; } @@ -184,6 +187,9 @@ static void *acceptor_thread(void *arg) if (dev_list == NULL || dev_list[0].handle == 0) { printf("No connected device found, terminating.\n"); free(dev_list); + if (cdata->fd > 0) { + close(cdata->fd); + } return NULL; } |