X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fcontext.c;fp=lib%2Fcontext.c;h=a044d1c49f833ff104c51065f8f0e79220d4bd7f;hp=5c9f4b06401d0dc23592d23c66b8bb3751fcd3f2;hb=f824ae0446c7a1ef3acd5d8e30c039c4ed7381ce;hpb=d0d82191bdac8626adf2489b89279f47805282ea diff --git a/lib/context.c b/lib/context.c index 5c9f4b06..a044d1c4 100644 --- a/lib/context.c +++ b/lib/context.c @@ -67,7 +67,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, struct trace_descriptor *td; struct format *fmt; struct bt_trace_handle *handle; - int ret; + int ret, closeret; if (!ctx || !format_name || (!path && !stream_list)) return -EINVAL; @@ -137,7 +137,10 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, return handle->id; error: - fmt->close_trace(td); + closeret = fmt->close_trace(td); + if (closeret) { + fprintf(stderr, "Error in close_trace callback\n"); + } end: return ret; } @@ -145,6 +148,7 @@ end: int bt_context_remove_trace(struct bt_context *ctx, int handle_id) { struct bt_trace_handle *handle; + int ret; if (!ctx) return -EINVAL; @@ -157,8 +161,11 @@ int bt_context_remove_trace(struct bt_context *ctx, int handle_id) /* Remove from containers */ trace_collection_remove(ctx->tc, handle->td); /* Close the trace */ - handle->format->close_trace(handle->td); - + ret = handle->format->close_trace(handle->td); + if (ret) { + fprintf(stderr, "Error in close_trace callback\n"); + return ret; + } /* Remove and free the handle */ g_hash_table_remove(ctx->trace_handles, (gpointer) (unsigned long) handle_id);