The kconsumerd_error_socket must be initialised to a negative value when
we create the context, otherwise we don't know if it is defined or just
random.
Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
+ ctx->kconsumerd_error_socket = -1;
/* assign the callbacks */
ctx->on_buffer_ready = buffer_ready;
ctx->on_recv_fd = recv_fd;
/* assign the callbacks */
ctx->on_buffer_ready = buffer_ready;
ctx->on_recv_fd = recv_fd;
DBG("Sending ready command to ltt-sessiond");
ret = lttng_kconsumerd_send_error(ctx, KCONSUMERD_COMMAND_SOCK_READY);
DBG("Sending ready command to ltt-sessiond");
ret = lttng_kconsumerd_send_error(ctx, KCONSUMERD_COMMAND_SOCK_READY);
+ /* return < 0 on error, but == 0 is not fatal */
if (ret < 0) {
ERR("Error sending ready command to ltt-sessiond");
goto end;
if (ret < 0) {
ERR("Error sending ready command to ltt-sessiond");
goto end;
/*
* Send return code to the session daemon.
/*
* Send return code to the session daemon.
+ * If the socket is not defined, we return 0, it is not a fatal error
*/
int lttng_kconsumerd_send_error(
struct lttng_kconsumerd_local_data *ctx, int cmd)
*/
int lttng_kconsumerd_send_error(
struct lttng_kconsumerd_local_data *ctx, int cmd)