*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#include <babeltrace/babeltrace.h>
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;
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;
}
int bt_context_remove_trace(struct bt_context *ctx, int handle_id)
{
struct bt_trace_handle *handle;
+ int ret;
if (!ctx)
return -EINVAL;
/* 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);