diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-07-18 12:48:18 +0300 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-07-18 13:41:22 +0200 |
commit | 02170de37bb0fd310918e608211120a3bf772650 (patch) | |
tree | d373f2908f8db717879b39923e86ec399f3f38b7 /android/hal-sco.c | |
parent | 2ed135a67acf953cc303938748eaf84fe0f6eda0 (diff) | |
download | bluez-02170de37bb0fd310918e608211120a3bf772650.tar.gz |
android/hal-sco: Fix leaving open socket
Close accepted socket always after poll loop.
Diffstat (limited to 'android/hal-sco.c')
-rw-r--r-- | android/hal-sco.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/android/hal-sco.c b/android/hal-sco.c index 7cbe558f3..b6ba55f5f 100644 --- a/android/hal-sco.c +++ b/android/hal-sco.c @@ -1246,14 +1246,12 @@ static void *ipc_handler(void *data) /* Check if socket is still alive. Empty while loop.*/ while (poll(&pfd, 1, -1) < 0 && errno == EINTR); - if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) { - info("SCO HAL: Socket closed"); + info("SCO HAL: Socket closed"); - pthread_mutex_lock(&sk_mutex); - close(ipc_sk); - ipc_sk = -1; - pthread_mutex_unlock(&sk_mutex); - } + pthread_mutex_lock(&sk_mutex); + close(ipc_sk); + ipc_sk = -1; + pthread_mutex_unlock(&sk_mutex); } info("Closing SCO IPC thread"); |