From cd07d72075739d6b59238d16fde6d02a1b97dbb9 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 5 Apr 2012 13:58:18 +0200 Subject: libusbmuxd: fix usbmuxd_unsubscribe() by using shutdown() instead of SIGINT --- libusbmuxd/libusbmuxd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libusbmuxd/libusbmuxd.c') 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 -- cgit v1.1-32-gdbae