Add missing error handling
[lttng-ust.git] / libust / ltt-ring-buffer-client.h
index e4845642fcfacc5e78ccc8086bbfe7dcd5a2a1f5..b3e6f007115ef99a58f30e5f09463c3549a6836e 100644 (file)
@@ -381,7 +381,9 @@ struct ltt_channel *_channel_create(const char *name,
        ltt_chan->handle = channel_create(&client_config, name, ltt_chan, buf_addr,
                              subbuf_size, num_subbuf, switch_timer_interval,
                              read_timer_interval);
-       ltt_chan->chan = shmp(handle, handle->chan);
+       if (!ltt_chan->handle)
+               return NULL;
+       ltt_chan->chan = shmp(ltt_chan->handle, ltt_chan->handle->chan);
        return ltt_chan;
 }
 
@@ -489,7 +491,7 @@ int ltt_is_disabled(struct channel *chan)
 }
 
 static struct ltt_transport ltt_relay_transport = {
-       .name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING,
+       .name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING "-mmap",
        .ops = {
                .channel_create = _channel_create,
                .channel_destroy = ltt_channel_destroy,
@@ -509,13 +511,13 @@ static struct ltt_transport ltt_relay_transport = {
 static
 void __attribute__((constructor)) ltt_ring_buffer_client_init(void)
 {
-       printf("LTT : ltt ring buffer client init\n");
+       DBG("LTT : ltt ring buffer client init\n");
        ltt_transport_register(&ltt_relay_transport);
 }
 
 static
 void __attribute__((destructor)) ltt_ring_buffer_client_exit(void)
 {
-       printf("LTT : ltt ring buffer client exit\n");
+       DBG("LTT : ltt ring buffer client exit\n");
        ltt_transport_unregister(&ltt_relay_transport);
 }
This page took 0.024667 seconds and 4 git commands to generate.