X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Flttng-live%2Flttng-live-comm.c;h=960c2240129cba5115223816b2a09f1578c5dd95;hp=e3cab91457fbf8ee2b6316a9bc4b31ad6143c7e6;hb=2875672988a4ff834617379e222a3c109fb5d903;hpb=66c2a20b4391fb5c7f870aeb0dde854f0ae1fc79 diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c index e3cab914..960c2240 100644 --- a/formats/lttng-live/lttng-live-comm.c +++ b/formats/lttng-live/lttng-live-comm.c @@ -1429,9 +1429,10 @@ error: return -1; } -void lttng_live_read(struct lttng_live_ctx *ctx) +int lttng_live_read(struct lttng_live_ctx *ctx) { - int ret, i; + int ret = -1; + int i; struct bt_ctf_iter *iter; const struct bt_ctf_event *event; struct bt_iter_pos begin_pos; @@ -1489,12 +1490,14 @@ void lttng_live_read(struct lttng_live_ctx *ctx) int flags; if (lttng_live_should_quit()) { + ret = 0; goto end_free; } while (!ctx->session->stream_count) { if (lttng_live_should_quit() || ctx->session_ids->len == 0) { + ret = 0; goto end_free; } ret = ask_new_streams(ctx); @@ -1517,6 +1520,7 @@ void lttng_live_read(struct lttng_live_ctx *ctx) } for (;;) { if (lttng_live_should_quit()) { + ret = 0; goto end_free; } event = bt_ctf_iter_read_event_flags(iter, &flags); @@ -1547,5 +1551,5 @@ void lttng_live_read(struct lttng_live_ctx *ctx) end_free: bt_context_put(ctx->bt_ctx); end: - return; + return ret; }