}
/* Init */
- lttng_consumer_init();
+ if (lttng_consumer_init() < 0) {
+ goto error;
+ }
+
+ /* Init socket timeouts */
+ lttcomm_init();
+ lttcomm_inet_init();
if (!getuid()) {
/* Set limit for open files */
}
ctx->type = opt_type;
+ /* Initialize communication library */
+ lttcomm_init();
+
/* Create thread to manage channels */
ret = pthread_create(&channel_thread, NULL, consumer_thread_channel_poll,
(void *) ctx);
error:
ret = EXIT_FAILURE;
- lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_EXIT_FAILURE);
+ if (ctx) {
+ lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_EXIT_FAILURE);
+ }
end:
lttng_consumer_destroy(ctx);