X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=converter%2Fbabeltrace.c;h=904c0150868630c47e60820a4e359635b6bf9588;hp=de9b49600fc5e0543690bc2104bfc6f194195e82;hb=ca71827554747d1a4dabf9d82a7c4eacb6f908d5;hpb=04ae3991741c634481fc3fa069664ae28bbdbaa6 diff --git a/converter/babeltrace.c b/converter/babeltrace.c index de9b4960..904c0150 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -327,7 +327,7 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, GArray *trace_ids; char lpath[PATH_MAX]; char * const paths[2] = { lpath, NULL }; - int ret; + int ret = -1; /* * Need to copy path, because fts_open can change it. @@ -383,17 +383,17 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, node->fts_accpath, format_str, packet_seek, NULL, NULL); if (trace_id < 0) { - fprintf(stderr, "[error] [Context] opening trace \"%s\" from %s " + fprintf(stderr, "[warning] [Context] opening trace \"%s\" from %s " "for reading.\n", node->fts_accpath, path); - ret = trace_id; - goto error; + /* Allow to skip erroneous traces. */ + continue; } g_array_append_val(trace_ids, trace_id); } } g_array_free(trace_ids, TRUE); - return 0; + return ret; error: return ret; @@ -420,7 +420,7 @@ int convert_trace(struct trace_descriptor *td_write, goto error_iter; } while ((ctf_event = bt_ctf_iter_read_event(iter))) { - ret = sout->parent.event_cb(&sout->parent, ctf_event->stream); + ret = sout->parent.event_cb(&sout->parent, ctf_event->parent->stream); if (ret) { fprintf(stderr, "[error] Writing event failed.\n"); goto end;