Cleanup: remove dead assignment
[lttng-tools.git] / src / common / consumer / consumer.c
index 482d4a63bd00a98c75ecb681390e4c211f69b62b..b99a3f5818ce40b3b57a09cc84c89b2c7a6e0dd4 100644 (file)
@@ -3355,7 +3355,7 @@ error:
  * This will create a relayd socket pair and add it to the relayd hash table.
  * The caller MUST acquire a RCU read side lock before calling it.
  */
-int consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type,
+ void consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type,
                struct lttng_consumer_local_data *ctx, int sock,
                struct pollfd *consumer_sockpoll,
                struct lttcomm_relayd_sock *relayd_sock, uint64_t sessiond_id,
@@ -3516,7 +3516,7 @@ int consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type,
        add_relayd(relayd);
 
        /* All good! */
-       return 0;
+       return;
 
 error:
        if (consumer_send_status_msg(sock, ret_code) < 0) {
@@ -3534,8 +3534,6 @@ error_nosignal:
        if (relayd_created) {
                free(relayd);
        }
-
-       return ret;
 }
 
 /*
@@ -3638,8 +3636,8 @@ int consumer_data_pending(uint64_t id)
                ret = relayd_begin_data_pending(&relayd->control_sock,
                                relayd->relayd_session_id);
                if (ret < 0) {
-                       pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                        /* Communication error thus the relayd so no data pending. */
+                       pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                        ERR("Relayd begin data pending failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
                        lttng_consumer_cleanup_relayd(relayd);
                        goto data_not_pending;
@@ -3663,6 +3661,8 @@ int consumer_data_pending(uint64_t id)
                                goto data_pending;
                        }
                        if (ret < 0) {
+                               ERR("Relayd data pending failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+                               lttng_consumer_cleanup_relayd(relayd);
                                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                                pthread_mutex_unlock(&stream->lock);
                                goto data_not_pending;
This page took 0.026181 seconds and 5 git commands to generate.