ret = lttcomm_listen_unix_sock(client_sock);
if (ret < 0) {
- goto error;
+ goto error_listen;
}
/*
*/
ret = create_thread_poll_set(&events, 2);
if (ret < 0) {
- goto error;
+ goto error_create_poll;
}
/* Add the application registration socket */
exit:
error:
- if (err) {
- health_error(&health_thread_cmd);
- ERR("Health error occurred in %s", __func__);
+ if (sock >= 0) {
+ ret = close(sock);
+ if (ret) {
+ PERROR("close");
+ }
}
- health_exit(&health_thread_cmd);
- DBG("Client thread dying");
+ lttng_poll_clean(&events);
+ clean_command_ctx(&cmd_ctx);
+
+error_listen:
+error_create_poll:
unlink(client_unix_sock_path);
if (client_sock >= 0) {
ret = close(client_sock);
PERROR("close");
}
}
- if (sock >= 0) {
- ret = close(sock);
- if (ret) {
- PERROR("close");
- }
+
+ if (err) {
+ health_error(&health_thread_cmd);
+ ERR("Health error occurred in %s", __func__);
}
- lttng_poll_clean(&events);
- clean_command_ctx(&cmd_ctx);
+ health_exit(&health_thread_cmd);
+
+ DBG("Client thread dying");
rcu_unregister_thread();
return NULL;