fix rotate pending on relay
[deliverable/lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index dcce32189d86d9411757ea8ef37df8e4e3961af2..55d792fd14bf24de51b274d1ac1274dfbb20044e 100644 (file)
@@ -1990,23 +1990,24 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                        /* Somehow, the session daemon is not responding anymore. */
                        goto end_nosignal;
                }
-
+               break;
        }
        case LTTNG_CONSUMER_ROTATE_PENDING_RELAY:
        {
+               uint32_t pending;
+
                DBG("Consumer rotate pending on relay for session %" PRIu64,
                                msg.u.rotate_pending_relay.session_id);
-               ret = lttng_consumer_rotate_pending_relay(
+               pending = lttng_consumer_rotate_pending_relay(
                                msg.u.rotate_pending_relay.session_id,
                                msg.u.rotate_pending_relay.relayd_id,
                                msg.u.rotate_pending_relay.chunk_id);
-               if (ret < 0) {
+               if (pending < 0) {
                        ERR("Rotate pending relay failed");
                        ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
                }
 
                health_code_update();
-               ret_code = ret;
 
                ret = consumer_send_status_msg(sock, ret_code);
                if (ret < 0) {
@@ -2014,6 +2015,13 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                        goto end_nosignal;
                }
 
+               /* Send back returned value to session daemon */
+               ret = lttcomm_send_unix_sock(sock, &pending, sizeof(pending));
+               if (ret < 0) {
+                       PERROR("send data pending ret code");
+                       goto error_fatal;
+               }
+               break;
        }
        default:
                break;
This page took 0.026722 seconds and 5 git commands to generate.