summaryrefslogtreecommitdiffstats
path: root/libusbmuxd/libusbmuxd.c
diff options
context:
space:
mode:
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)
602 602
603 collection_free(&devices); 603 collection_free(&devices);
604 604
605 close_socket(listenfd);
606 listenfd = -1;
607
605 return NULL; 608 return NULL;
606} 609}
607 610
@@ -634,17 +637,14 @@ int usbmuxd_unsubscribe()
634{ 637{
635 event_cb = NULL; 638 event_cb = NULL;
636 639
640 shutdown_socket(listenfd, SHUT_RDWR);
641
637#ifdef WIN32 642#ifdef WIN32
638 if (devmon != NULL) { 643 if (devmon != NULL) {
639 close_socket(listenfd);
640 listenfd = -1;
641 WaitForSingleObject(devmon, INFINITE); 644 WaitForSingleObject(devmon, INFINITE);
642 } 645 }
643#else 646#else
644 if (pthread_kill(devmon, 0) == 0) { 647 if (pthread_kill(devmon, 0) == 0) {
645 close_socket(listenfd);
646 listenfd = -1;
647 pthread_kill(devmon, SIGINT);
648 pthread_join(devmon, NULL); 648 pthread_join(devmon, NULL);
649 } 649 }
650#endif 650#endif