diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2014-05-20 12:59:30 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-06-12 13:04:30 +0200 |
commit | 5272cc4976acf7e0d3ab3c0207b4fe7d4e29bc66 (patch) | |
tree | 629039b815e63de987d5d342dc5bcc2f41ff065a /android/hal-ipc.c | |
parent | 248a15dab9b3288a1ad954df17864d10003d1940 (diff) | |
download | bluez-5272cc4976acf7e0d3ab3c0207b4fe7d4e29bc66.tar.gz |
android/hal-ipc: Move exit calls under label in notification_handler
This reduce number of exit points in preparation for destroy callback.
Diffstat (limited to 'android/hal-ipc.c')
-rw-r--r-- | android/hal-ipc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/android/hal-ipc.c b/android/hal-ipc.c index 2cc6edafb..59bc3dc0b 100644 --- a/android/hal-ipc.c +++ b/android/hal-ipc.c @@ -154,9 +154,9 @@ static void *notification_handler(void *data) ret = recvmsg(notif_sk, &msg, 0); if (ret < 0) { - error("Receiving notifications failed, aborting :%s", + error("Receiving notifications failed: %s", strerror(errno)); - exit(EXIT_FAILURE); + goto failed; } /* socket was shutdown */ @@ -168,8 +168,8 @@ static void *notification_handler(void *data) } pthread_mutex_unlock(&cmd_sk_mutex); - error("Notification socket closed, aborting"); - exit(EXIT_FAILURE); + error("Notification socket closed"); + goto failed; } fd = -1; @@ -185,7 +185,7 @@ static void *notification_handler(void *data) } if (!handle_msg(buf, ret)) - exit(EXIT_FAILURE); + goto failed; } close(notif_sk); @@ -196,6 +196,9 @@ static void *notification_handler(void *data) DBG("exit"); return NULL; + +failed: + exit(EXIT_FAILURE); } static int accept_connection(int sk) |