compat: fix compilation with !BABELTRACE_HAVE_OPEN_MEMSTREAM
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-stream.c
index 64aecd47ad02f1515d9430dc93d5aa55327e22e4..b14e6d556d9e02088d58619548f3ddcb5890c0c0 100644 (file)
@@ -1,23 +1,7 @@
 /*
- * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * SPDX-License-Identifier: MIT
  *
- * 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.
+ * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
  */
 
 #define BT_COMP_LOG_SELF_COMP (stream->trace->fs_sink->self_comp)
@@ -120,7 +104,7 @@ GString *make_unique_stream_file_name(struct fs_sink_trace *trace,
 
        BT_ASSERT(name);
 
-       while (stream_file_name_exists(trace, name->str) &&
+       while (stream_file_name_exists(trace, name->str) ||
                        strcmp(name->str, "metadata") == 0) {
                g_string_printf(name, "%s-%u", san_base->str, suffix);
                suffix++;
@@ -391,7 +375,7 @@ int write_variant_field(struct fs_sink_stream *stream,
                const bt_field *field)
 {
        uint64_t opt_index =
-               bt_field_variant_get_selected_option_field_index(field);
+               bt_field_variant_get_selected_option_index(field);
        int ret;
 
        if (fc->tag_is_before) {
@@ -449,7 +433,7 @@ int write_field(struct fs_sink_stream *stream,
                ret = write_variant_field(stream, (void *) fc, field);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return ret;
This page took 0.022742 seconds and 4 git commands to generate.