summaryrefslogtreecommitdiffstats
path: root/libusbmuxd/libusbmuxd.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-04-05 13:58:18 +0200
committerGravatar Nikias Bassen2012-04-05 13:58:18 +0200
commitcd07d72075739d6b59238d16fde6d02a1b97dbb9 (patch)
treec14160d287a0b01dd6dd4843a0a001849624df04 /libusbmuxd/libusbmuxd.c
parentb63c3355bd194d1df83b2f5aa0affab411397dd4 (diff)
downloadusbmuxd-cd07d72075739d6b59238d16fde6d02a1b97dbb9.tar.gz
usbmuxd-cd07d72075739d6b59238d16fde6d02a1b97dbb9.tar.bz2
libusbmuxd: fix usbmuxd_unsubscribe() by using shutdown() instead of SIGINT
Diffstat (limited to 'libusbmuxd/libusbmuxd.c')
-rw-r--r--libusbmuxd/libusbmuxd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c
index 172da80..02aa750 100644
--- a/libusbmuxd/libusbmuxd.c
+++ b/libusbmuxd/libusbmuxd.c
@@ -602,6 +602,9 @@ static void *device_monitor(void *data)
collection_free(&devices);
+ close_socket(listenfd);
+ listenfd = -1;
+
return NULL;
}
@@ -634,17 +637,14 @@ int usbmuxd_unsubscribe()
{
event_cb = NULL;
+ shutdown_socket(listenfd, SHUT_RDWR);
+
#ifdef WIN32
if (devmon != NULL) {
- close_socket(listenfd);
- listenfd = -1;
WaitForSingleObject(devmon, INFINITE);
}
#else
if (pthread_kill(devmon, 0) == 0) {
- close_socket(listenfd);
- listenfd = -1;
- pthread_kill(devmon, SIGINT);
pthread_join(devmon, NULL);
}
#endif